private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); Set<UnaryRule> allRules = Generics.newHashSet(coreRules.keySet()); init(); for (UnaryRule ur : allRules) { addRule(ur); } purgeRules(); }
/** * Populates data in this UnaryGrammar from a character stream. * * @param in The Reader the grammar is read from. * @throws IOException If there is a reading problem */ public void readData(BufferedReader in) throws IOException { String line; int lineNum = 1; // all lines have one rule per line line = in.readLine(); while (line != null && line.length() > 0) { try { addRule(new UnaryRule(line, index)); } catch (Exception e) { throw new IOException("Error on line " + lineNum); } lineNum++; line = in.readLine(); } purgeRules(); }
newUG.addRule(unaryRule); newUG.purgeRules();
ug.purgeRules(); bg.splitRules(); return new Pair<>(ug, bg);
bg.splitRules(); ug = bgug.first; ug.purgeRules(); Timing.tick("done.");
ug.purgeRules(); Timing.tick("done.");
bg.splitRules(); UnaryGrammar ug = bgug.first; ug.purgeRules(); Timing.tick("done");
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); Set<UnaryRule> allRules = new HashSet<UnaryRule>(coreRules.keySet()); init(); for (UnaryRule ur : allRules) { addRule(ur); } purgeRules(); }
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); Set<UnaryRule> allRules = Generics.newHashSet(coreRules.keySet()); init(); for (UnaryRule ur : allRules) { addRule(ur); } purgeRules(); }
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); Set<UnaryRule> allRules = Generics.newHashSet(coreRules.keySet()); init(); for (UnaryRule ur : allRules) { addRule(ur); } purgeRules(); }
/** * Populates data in this UnaryGrammar from a character stream. * * @param in The Reader the grammar is read from. * @throws IOException If there is a reading problem */ public void readData(BufferedReader in) throws IOException { String line; int lineNum = 1; // all lines have one rule per line line = in.readLine(); while (line != null && line.length() > 0) { try { addRule(new UnaryRule(line, index)); } catch (Exception e) { throw new IOException("Error on line " + lineNum); } lineNum++; line = in.readLine(); } purgeRules(); }
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); Set<UnaryRule> allRules = Generics.newHashSet(coreRules.keySet()); init(); for (UnaryRule ur : allRules) { addRule(ur); } purgeRules(); }
/** * Populates data in this UnaryGrammar from a character stream. * * @param in The Reader the grammar is read from. * @throws IOException If there is a reading problem */ public void readData(BufferedReader in) throws IOException { String line; int lineNum = 1; // all lines have one rule per line line = in.readLine(); while (line != null && line.length() > 0) { try { addRule(new UnaryRule(line, index)); } catch (Exception e) { throw new IOException("Error on line " + lineNum); } lineNum++; line = in.readLine(); } purgeRules(); }
/** * Populates data in this UnaryGrammar from a character stream. * * @param in The Reader the grammar is read from. * @throws IOException If there is a reading problem */ public void readData(BufferedReader in) throws IOException { String line; int lineNum = 1; // all lines have one rule per line line = in.readLine(); while (line != null && line.length() > 0) { try { addRule(new UnaryRule(line, index)); } catch (Exception e) { throw new IOException("Error on line " + lineNum); } lineNum++; line = in.readLine(); } purgeRules(); }
/** * Populates data in this UnaryGrammar from a character stream. * * @param in The Reader the grammar is read from. * @throws IOException If there is a reading problem */ public void readData(BufferedReader in) throws IOException { String line; int lineNum = 1; Numberer n = Numberer.getGlobalNumberer(stateSpace); // all lines have one rule per line line = in.readLine(); while (line != null && line.length() > 0) { try { addRule(new UnaryRule(line, n)); } catch (Exception e) { throw new IOException("Error on line " + lineNum); } lineNum++; line = in.readLine(); } purgeRules(); }
ug.addRule(ur); ug.purgeRules();
ug.purgeRules(); bg.splitRules(); return new Pair<>(ug, bg);
ug.purgeRules(); bg.splitRules(); return new Pair<UnaryGrammar,BinaryGrammar>(ug, bg);
bg.splitRules(); UnaryGrammar ug = bgug.first; ug.purgeRules(); Timing.tick("done");