/** Creates a read-once arc-list ASCII graph. Instances created using this constructor can be * only accessed using a single call to {@link #nodeIterator(int)}. * * @param is an input stream containing an arc-list ASCII graph. */ public ArcListASCIIGraph(final InputStream is, final int shift) throws NumberFormatException, IOException { this.shift = shift; fbr = new FastBufferedReader(new InputStreamReader(is, "ASCII")); n = -1; }
private FileLinesIterator( final String filename, final String encoding, final boolean zipped ) { try { fbr = encoding != null ? new FastBufferedReader( new InputStreamReader( zipped ? new GZIPInputStream( new FileInputStream( filename ) ) : new FileInputStream( filename ), encoding ) ) : new FastBufferedReader( new FileReader( filename ) ); } catch (IOException e) { throw new RuntimeException( e ); } }
private FileLinesIterator(final String filename, final String encoding, final boolean zipped) { try { fbr = encoding != null ? new FastBufferedReader(new InputStreamReader(zipped ? new GZIPInputStream(new FileInputStream(filename)) : new FileInputStream(filename), encoding)) : new FastBufferedReader(new FileReader(filename)); } catch (final IOException e) { throw new RuntimeException(e); } }
private FileLinesIterator(final String filename, final String encoding, final boolean zipped) { try { fbr = encoding != null ? new FastBufferedReader(new InputStreamReader(zipped ? new GZIPInputStream(new FileInputStream(filename)) : new FileInputStream(filename), encoding)) : new FastBufferedReader(new FileReader(filename)); } catch (final IOException e) { throw new RuntimeException(e); } }
private FileLinesIterator( final String filename, final String encoding, final boolean zipped ) { try { fbr = encoding != null ? new FastBufferedReader( new InputStreamReader( zipped ? new GZIPInputStream( new FileInputStream( filename ) ) : new FileInputStream( filename ), encoding ) ) : new FastBufferedReader( new FileReader( filename ) ); } catch (IOException e) { throw new RuntimeException( e ); } }
public Object content( final int field ) throws IOException { ensureFieldIndex( field ); ensureParsed(); switch( field ) { case 0: return new FastBufferedReader( textExtractor.text ); case 1: return new FastBufferedReader( textExtractor.title ); case 2: return anchorExtractor.anchors; default: throw new IllegalArgumentException(); } }
public FileLinesIterator( final IOFactory ioFactory, final String filename, final String encoding ) { try { fbr = new FastBufferedReader( new InputStreamReader( ioFactory.getInputStream( filename ), encoding ) ); } catch (IOException e) { throw new RuntimeException( e ); } }
public Object content( final int field ) throws IOException { ensureFieldIndex( field ); ensureParsed(); switch( field ) { case 0: return new FastBufferedReader( textExtractor.text ); case 1: return new FastBufferedReader( textExtractor.title ); case 2: return anchorExtractor.anchors; default: throw new IllegalArgumentException(); } }
public Object content( final int field ) throws IOException { ensureFieldIndex( field ); ensureParsed(); switch( field ) { case 0: return new FastBufferedReader( textExtractor.text ); case 1: return new FastBufferedReader( textExtractor.title ); case 2: return anchorExtractor.anchors; default: throw new IllegalArgumentException(); } }
private void init() { try { final Object 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 ); } }
private void init() { try { final Object 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 ); } }
private void init() { try { final Object 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 ); } }
/** Creates a read-once ASCII graph. Instances created using this constructor can be * only accessed using a single call to {@link #nodeIterator(int)}. * * @param is an input stream containing an ASCII graph. */ public ASCIIGraph(final InputStream is) throws NumberFormatException, IOException { graphFile = null; fbr = new FastBufferedReader(new InputStreamReader(is, "ASCII")); n = Integer.parseInt(fbr.readLine(new MutableString()).toString()); if (n < 0) throw new IllegalArgumentException("Number of nodes must be nonnegative"); }
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 ); } }
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 ); } }
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 ); } }
public enum IndexType { /** An old-style, interleaved index. */ INTERLEAVED, /** A high-performance index which stores position separately. */ HIGH_PERFORMANCE, /** A quasi-succinct index. */ QUASI_SUCCINCT }
public enum IndexType { /** An old-style, interleaved index. */ INTERLEAVED, /** A high-performance index which stores position separately. */ HIGH_PERFORMANCE, /** A quasi-succinct index. */ QUASI_SUCCINCT }
private Reader joinAddresses( final Address address[] ) { if ( address == null ) return NullReader.getInstance(); final MutableString s = new MutableString(); if ( address != null ) { for( int i = 0; i < address.length; i++ ) { if ( i > 0 ) s.append( ", " ); s.append( address[ i ] ); } } return new FastBufferedReader( s ); }
private Reader joinAddresses( final Address address[] ) { if ( address == null ) return NullReader.getInstance(); final MutableString s = new MutableString(); if ( address != null ) { for( int i = 0; i < address.length; i++ ) { if ( i > 0 ) s.append( ", " ); s.append( address[ i ] ); } } return new FastBufferedReader( s ); }