/** * Writes an automaton to a file. */ public void save(final Path path) throws IOException { try (OutputStream os = new BufferedOutputStream(Files.newOutputStream(path))) { save(new OutputStreamDataOutput(os)); } }
root.index.save(indexOut);
@Override public boolean store(DataOutput output) throws IOException { output.writeVLong(count); if (fst == null) { return false; } fst.save(output); output.writeVInt(maxAnalyzedPathsForOneInput); output.writeByte((byte) (hasPayloads ? 1 : 0)); return true; }
@Override public boolean store(OutputStream output) throws IOException { DataOutput dataOut = new OutputStreamDataOutput(output); try { if (fst == null) { return false; } fst.save(dataOut); dataOut.writeVInt(maxAnalyzedPathsForOneInput); dataOut.writeByte((byte) (hasPayloads ? 1 : 0)); } finally { IOUtils.close(output); } return true; }
@Override public boolean store(DataOutput output) throws IOException { output.writeVLong(count); if (fst == null) { return false; } fst.save(output); return true; }
/** * Writes an automaton to a file. */ public void save(final Path path) throws IOException { try (OutputStream os = new BufferedOutputStream(Files.newOutputStream(path))) { save(new OutputStreamDataOutput(os)); } }
@Override public void finish(long termsFilePointer) throws IOException { fst = fstBuilder.finish(); if (fst != null) { fst.save(out); } } }
/** * Writes an automaton to a file. */ public void save(final Path path) throws IOException { try (OutputStream os = new BufferedOutputStream(Files.newOutputStream(path))) { save(new OutputStreamDataOutput(os)); } }
/** * Writes an automaton to a file. */ public void save(final Path path) throws IOException { try (OutputStream os = new BufferedOutputStream(Files.newOutputStream(path))) { save(new OutputStreamDataOutput(os)); } }
@Override public boolean store(OutputStream output) throws IOException { OutputStream os = new BufferedOutputStream(output); try { this.automaton.save(new OutputStreamDataOutput(os)); } finally { IOUtils.close(os); } return true; }
@Override public boolean store(OutputStream output) throws IOException { try { if (fst == null) { return false; } fst.save(new OutputStreamDataOutput(output)); } finally { IOUtils.close(output); } return true; }
@Override public boolean store(DataOutput output) throws IOException { output.writeVLong(count); if (fst == null) { return false; } fst.save(output); output.writeVInt(maxAnalyzedPathsForOneInput); output.writeByte((byte) (hasPayloads ? 1 : 0)); return true; }
@Override public synchronized boolean store(DataOutput output) throws IOException { output.writeVLong(count); if (this.normalCompletion == null || normalCompletion.getFST() == null) return false; normalCompletion.getFST().save(output); return true; }
@Override public boolean store(DataOutput output) throws IOException { output.writeVLong(count); if (fst == null) { return false; } fst.save(output); output.writeVInt(maxAnalyzedPathsForOneInput); output.writeByte((byte) (hasPayloads ? 1 : 0)); return true; }
@Override public boolean store(DataOutput output) throws IOException { output.writeVLong(count); if (fst == null) { return false; } fst.save(output); output.writeVInt(maxAnalyzedPathsForOneInput); output.writeByte((byte) (hasPayloads ? 1 : 0)); return true; }
@Override public boolean store(DataOutput output) throws IOException { output.writeVLong(count); if (fst == null) { return false; } fst.save(output); output.writeVInt(maxAnalyzedPathsForOneInput); output.writeByte((byte) (hasPayloads ? 1 : 0)); return true; }
@Override public boolean store(DataOutput output) throws IOException { output.writeVLong(count); if (fst == null) { return false; } fst.save(output); output.writeVInt(maxAnalyzedPathsForOneInput); output.writeByte((byte) (hasPayloads ? 1 : 0)); return true; }
@Override public synchronized boolean store(OutputStream output) throws IOException { try { if (this.normalCompletion == null || normalCompletion.getFST() == null) return false; normalCompletion.getFST().save(new OutputStreamDataOutput(output)); } finally { IOUtils.close(output); } return true; }
@Override public boolean store(OutputStream output) throws IOException { DataOutput dataOut = new OutputStreamDataOutput(output); try { if (fst == null) { return false; } fst.save(dataOut); dataOut.writeVInt(maxAnalyzedPathsForOneInput); dataOut.writeByte((byte) (hasPayloads ? 1 : 0)); } finally { IOUtils.close(output); } return true; }
@Override public boolean store(DataOutput output) throws IOException { CodecUtil.writeHeader(output, CODEC_NAME, VERSION_CURRENT); output.writeVLong(count); output.writeByte(separator); output.writeVInt(grams); output.writeVLong(totTokens); fst.save(output); return true; }