Package it.unimi.dsi.io

Examples of it.unimi.dsi.io.FastBufferedReader


              for( int i = 0; i < address.length; i++ ) {
                if ( i > 0 ) s.append( ", " );
                s.append( address[ i ] );
              }
            }
            return new FastBufferedReader( s );
          }
         
          public Object content( final int field ) throws IOException {
            factory.ensureFieldIndex( field );
            try {
View Full Code Here


      super( property );
      init();
    }
   
    private void init() {
      wordReader = new FastBufferedReader();
    }
View Full Code Here

          virtualDocumentResolver[ i ].context( document );
          for( VirtualDocumentFragment fragment: fragments ) {
            int virtualDocumentPointer = virtualDocumentResolver[ i ].resolve( fragment.documentSpecifier() );
            if ( virtualDocumentPointer < 0 ) continue;
            if ( map != null ) virtualDocumentPointer = map[ virtualDocumentPointer ];
            wordReader.setReader( new FastBufferedReader( fragment.text() ) );
            scan[ i ].processDocument( virtualDocumentPointer, wordReader );
          }
          if ( building ) builder.virtualField( fragments );
          overallTerms += scan[ i ].numTerms;
          break;
View Full Code Here

    final String basename = jsapResult.getString( "basename" );
    final PrintStream printStream[] = new PrintStream[ h + 1 ];
    for( int i = 0; i <= h; i++ ) printStream[ i ] = new PrintStream( new FastBufferedOutputStream( new FileOutputStream( basename + "-" + i + DiskBasedIndex.STATS_EXTENSION ) ) );
   
    final MutableString line = new MutableString();
    final FastBufferedReader reader = new FastBufferedReader( new InputStreamReader( System.in ) );
   
    int l, start;
    while( reader.readLine( line ) != null ) {
      if ( line.charAt( 0 ) == '#' ) continue;
      matcher.reset( line );
      l = 0;
      start = 0;
      while( matcher.find() && l <= h ) {
View Full Code Here

    //for ( q = 0; q < queries; q++ )  System.out.println( "Query " + q + ": " + new IntArrayList( docForQuery[ q ] ) );
     
   
    String split[];
    int words[] = new int[ 1024 ];
    final FastBufferedReader reader = new FastBufferedReader( new InputStreamReader( System.in, "UTF-8" ) );
   
    int lineNumber = 0;
    int numberOfPartialQueries = queries;
    ProgressLogger pl = new ProgressLogger( LOGGER );
    pl.itemsName = "Klines";
    pl.expectedUpdates = maxDoc / 1000;
    pl.start( "Generating queries..." );
    MutableString line = new MutableString();
    while( reader.readLine( line ) != null && numberOfPartialQueries > 0 ) {
      if ( used[ lineNumber ] ) {
        for ( q = 0; q < queries; q++ )
          if ( coveredForQuery[ q ] < docperquery && docForQuery[ q ][ coveredForQuery[ q ] ] == lineNumber ) {
            split = line.toString().split( " " );
            int nw = split.length;
View Full Code Here

      if ( haveCounts ) localGlobCounts[ i ] = new OutputBitStream( name + DiskBasedIndex.GLOBCOUNTS_EXTENSION );
      localFrequencies[ i ] = new OutputBitStream( name + DiskBasedIndex.FREQUENCIES_EXTENSION );
      localTerms[ i ] = new PrintWriter( new BufferedWriter( new OutputStreamWriter( new FileOutputStream( localBasename[ i ] + DiskBasedIndex.TERMS_EXTENSION ), "UTF-8" ) ) );     
    }
   
    terms = new FastBufferedReader( new InputStreamReader( new FileInputStream( inputBasename + DiskBasedIndex.TERMS_EXTENSION ), "UTF-8" ) );
  }
View Full Code Here

  private void init() {
    Object o = defaultMetadata.get( MetadataKeys.FIELDNAME );
    fieldName = o == null ? "text" : o.toString();
    try {
      o = defaultMetadata.get( PropertyBasedDocumentFactory.MetadataKeys.WORDREADER );
      wordReader = o == null ? new FastBufferedReader() : ObjectParser.fromSpec( o.toString(), WordReader.class, MG4JClassParser.PACKAGE );
    }
    catch ( Exception e ) {
      throw new RuntimeException( e );
    }
  }
View Full Code Here

              s.readSelfDelimUTF8( nonTermsInputStream );
              fieldContent.append( s );
            }
            else fieldContent.append( ' ');
          }
          return new FastBufferedReader( fieldContent );
        case VIRTUAL:
          final int nfrag = nonTextDataInputStream.readInt();
          MutableString doc = new MutableString();
          MutableString text = new MutableString();
          VirtualDocumentFragment[] fragArray = new VirtualDocumentFragment[ nfrag ];
View Full Code Here

  public MarkingMutableString appendAndMark( final String s ) {
    return appendAndMark( new MutableString( s ) );
  }
 
  public MarkingMutableString appendAndMark( final MutableString s ) {
    return appendAndMark( new FastBufferedReader( s ) );
  }
View Full Code Here

    for( int t = 0; t < numberOfTerms; t++ ) gc[ t ] = globCounts.readLongGamma();
    globCounts.close();

    final MutableString line = new MutableString();
    MutableString number;
    final FastBufferedReader reader = new FastBufferedReader( new FileReader( statFile ) );
   
    boolean dumping = false;
    int f, q;
    reader.readLine( line );
    while( reader.readLine( line ) != null ) {
      if ( line.charAt( 0 ) == '#' ) {
        number = line.substring( 2 );
        f = Integer.parseInt( number.delete( number.indexOf( ' ' ), number.length() ).toString() );
        double freq = (double)gc[ f ] / numberOfoccurrences;
        if ( print ) System.out.println( line + " " + format( freq ) );
View Full Code Here

TOP

Related Classes of it.unimi.dsi.io.FastBufferedReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.