From f21ad66c98e7720e6e80d92860c43ebaefffc4e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Navickas?= Date: Fri, 12 Jul 2019 13:18:30 +0300 Subject: [PATCH 01/28] We want to be able to initialize these later --- src/opennlp/ccg/grammar/Grammar.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/opennlp/ccg/grammar/Grammar.java b/src/opennlp/ccg/grammar/Grammar.java index df632b2..61858a7 100644 --- a/src/opennlp/ccg/grammar/Grammar.java +++ b/src/opennlp/ccg/grammar/Grammar.java @@ -52,13 +52,13 @@ public class Grammar { /** The lexicon. */ - public final Lexicon lexicon; + public Lexicon lexicon; /** The rule group. */ - public final RuleGroup rules; + public RuleGroup rules; /** The type hierarchy. */ - public final Types types; + public Types types; /** The features to include in supertags. */ public final Set supertagFeatures = new HashSet(); From 72e0e7bf05fee634872d669de496c7fbe212b1ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Navickas?= Date: Fri, 12 Jul 2019 13:23:58 +0300 Subject: [PATCH 02/28] Lazy set grammar --- src/opennlp/ccg/grammar/RuleGroup.java | 11 +- src/opennlp/ccg/grammar/Types.java | 532 ++++++++++++----------- src/opennlp/ccg/grammar/WithGrammar.java | 5 + src/opennlp/ccg/lexicon/Lexicon.java | 12 +- 4 files changed, 295 insertions(+), 265 deletions(-) create mode 100644 src/opennlp/ccg/grammar/WithGrammar.java diff --git a/src/opennlp/ccg/grammar/RuleGroup.java b/src/opennlp/ccg/grammar/RuleGroup.java index 324c884..fa87a91 100644 --- a/src/opennlp/ccg/grammar/RuleGroup.java +++ b/src/opennlp/ccg/grammar/RuleGroup.java @@ -44,7 +44,7 @@ * @author Michael White * @version $Revision: 1.32 $, $Date: 2011/06/07 05:12:01 $ */ -public class RuleGroup implements Serializable { +public class RuleGroup implements Serializable, WithGrammar { private static final long serialVersionUID = -6240266013357142289L; @@ -156,6 +156,11 @@ SupercatRuleCombo get(SupercatRuleCombo combo) { /** * Constructs an empty rule group for the given grammar. */ + + public RuleGroup(){ + bapp.setRuleGroup(this); + } + public RuleGroup(Grammar grammar) { this.grammar = grammar; bapp.setRuleGroup(this); @@ -185,6 +190,10 @@ public void handleElement(Element ruleEl) { ruleScanner.parse(url); } + public void setGrammar(Grammar grammar){ + this.grammar = grammar; + } + // during deserialization, sets grammar to the current grammar private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { diff --git a/src/opennlp/ccg/grammar/Types.java b/src/opennlp/ccg/grammar/Types.java index ef630da..efd0cbd 100644 --- a/src/opennlp/ccg/grammar/Types.java +++ b/src/opennlp/ccg/grammar/Types.java @@ -1,262 +1,270 @@ -/////////////////////////////////////////////////////////////////////////////// -//// Copyright (C) 2003-4 Gunes Erkan and University of Edinburgh (Michael White) -//// -//// This library is free software; you can redistribute it and/or -//// modify it under the terms of the GNU Lesser General Public -//// License as published by the Free Software Foundation; either -//// version 2.1 of the License, or (at your option) any later version. -//// -//// This library is distributed in the hope that it will be useful, -//// but WITHOUT ANY WARRANTY; without even the implied warranty of -//// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//// GNU Lesser General Public License for more details. -//// -//// You should have received a copy of the GNU Lesser General Public -//// License along with this program; if not, write to the Free Software -//// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -//////////////////////////////////////////////////////////////////////////////// - -package opennlp.ccg.grammar; - -import opennlp.ccg.util.*; -import opennlp.ccg.unify.*; - -import org.jdom.*; -import org.jdom.input.*; - -import java.io.*; -import java.net.*; -import java.util.*; - -import gnu.trove.*; - -/** - * Class for constructing and holding the hierarchical simple type maps. - * - * @author Gunes Erkan - * @author Michael White - * @version $Revision: 1.13 $, $Date: 2009/12/21 03:27:18 $ - */ -public class Types { - - public final Grammar grammar; - private final HashMap nameToType = new HashMap(); - private final ArrayList indexToType = new ArrayList(); - private int maxTypeIndex = 0; - public static final String TOP_TYPE = "top"; - public static final String BOT_TYPE = "bottom"; - - /** Constructor for an empty hierarchy (with just the top type). */ - public Types(Grammar grammar) { - getSimpleType(TOP_TYPE); - this.grammar = grammar; - } - - /** - * Constructs the type hierarchy from the given URL, for - * the given grammar. - */ - @SuppressWarnings("unchecked") - public Types(URL url, Grammar grammar) throws IOException { - this.grammar = grammar; - SAXBuilder builder = new SAXBuilder(); - Document doc; - try { - doc = builder.build(url); - } - catch (JDOMException exc) { - getSimpleType(TOP_TYPE); - throw (IOException) new IOException().initCause(exc); - } - List entries = doc.getRootElement().getChildren(); - readTypes(entries); - // for debugging: print the indexToType list - //printTypes(); - } - - /** Returns the simple type with the given name, or a new one if none yet exists. */ - public SimpleType getSimpleType(String typeName) { - SimpleType type = nameToType.get(typeName); - if (type == null) { - BitSet bs = new BitSet(); - bs.set(maxTypeIndex); - SimpleType newtype = new SimpleType(maxTypeIndex, typeName, bs, this); - nameToType.put(typeName, newtype); - indexToType.add(newtype); - nameToType.get(TOP_TYPE).getBitSet().set(maxTypeIndex++); - return newtype; - } - else return type; - } - - /** Returns whether there is a simple type with the given name. */ - public boolean containsSimpleType(String typeName) { - return nameToType.containsKey(typeName); - } - - /** Returns the list of types, with parents preceding children in the hierarchy. */ - public ArrayList getIndexMap() { - return indexToType; - } - - - /** Reads the rules and constructs the nameToType and indexToType maps. */ - private void readTypes(List _types) { - - GroupMap hierarchy = new GroupMap(); // map from types to all subtypes - GroupMap parents = new GroupMap(); // map from types to parents - TObjectIntHashMap depthMap = new TObjectIntHashMap(); // map from types to max depth - - // Construct the initial hierarchy of types without - // taking transitive closure. - // Also store parents. - for (int i=0; i < _types.size(); i++) { - Element typeEl = _types.get(i); - String typeName = typeEl.getAttributeValue("name"); - String _parents = typeEl.getAttributeValue("parents"); - hierarchy.put(typeName, BOT_TYPE); - if (_parents == null) { - hierarchy.put(TOP_TYPE, typeName); - parents.put(typeName, TOP_TYPE); - } - else { - String[] parentsArray = _parents.split("\\s+"); - for (int j = 0; j < parentsArray.length; j++) { - hierarchy.put(parentsArray[j], typeName); - parents.put(typeName, parentsArray[j]); - } - } - } - - // Compute depth from parents. - for (String type : parents.keySet()) { - int depth = computeDepth(type, parents, type); - depthMap.put(type, depth); - } - - // Compute ALL subtypes of each type and insert into the hierarchy. - for (String type : hierarchy.keySet()) { - hierarchy.putAll(type, findAllSubtypes(hierarchy, type)); - } - - // Assign a unique int to each type in breadth-first order. - // Then create the string -> SimpleType map. - createSimpleTypes(hierarchy, depthMap); - } - - /** Returns the max depth of the given type, checking for cycles. */ - private static int computeDepth(String type, GroupMap parents, String startType) { - if (type.equals(TOP_TYPE)) return 0; - int maxParentDepth = 0; - Set parentSet = parents.get(type); - if (parentSet != null) { - for (String parent : parentSet) { - if (parent.equals(startType)) { - throw new RuntimeException("Error, type hierarchy contains cycle from/to: " + startType); - } - int parentDepth = computeDepth(parent, parents, startType); - maxParentDepth = Math.max(maxParentDepth, parentDepth); - } - } - return maxParentDepth + 1; - } - - /** - * Computes the list of all sub-types of a given type (key) - * in depth-first order. - */ - private Collection findAllSubtypes(GroupMap hierarchy, String key) { - ArrayList subs = new ArrayList(); - if (hierarchy.get(key) != null) { - Stack look = new Stack(); - for (String type : hierarchy.get(key)) { - look.push(type); - } - for (; !look.empty() ; ) { - String new_sub = look.pop(); - subs.add(new_sub); - if (hierarchy.get(new_sub) != null) { - for (String type : hierarchy.get(new_sub)) { - look.push(type); - } - } - } - } - return subs; - } - - /** - * Creates the SimpleType objects and constructs the nameToType and indexToType maps. - */ - private void createSimpleTypes(GroupMap hierarchy, TObjectIntHashMap depthMap) { - - // find max depth - int maxDepth = 0; - int[] depths = depthMap.getValues(); - for (int i = 0; i < depths.length; i++) { - maxDepth = Math.max(maxDepth, depths[i]); - } - - // add types in order of increasing depth - ArrayList typesVisited = new ArrayList(); - typesVisited.add(TOP_TYPE); - Object[] types = depthMap.keys(); - ArrayList typesAtSameDepth = new ArrayList(); - for (int i = 1; i <= maxDepth; i++) { - typesAtSameDepth.clear(); - for (int j = 0; j < types.length; j++) { - if (depthMap.get(types[j]) == i) - typesAtSameDepth.add((String)types[j]); - } - Collections.sort(typesAtSameDepth); - typesVisited.addAll(typesAtSameDepth); - } - - // construct the maps - for (int i=0; i < typesVisited.size(); i++) { - String typeName = typesVisited.get(i); - BitSet bitset = new BitSet(); - bitset.set(i); - if (hierarchy.get(typeName) != null) { - for (String type : hierarchy.get(typeName)) { - int indexToSet = typesVisited.indexOf(type); - if (indexToSet != -1) bitset.set(indexToSet); - } - } - SimpleType st = new SimpleType(i, typeName, bitset, this); - nameToType.put(typeName, st); - indexToType.add(st); - } - maxTypeIndex = typesVisited.size(); - } - - /** - * Prints the types and their subtypes to System.out. - */ - public void printTypes() { - System.out.println("types:"); - for (int i=0; i < indexToType.size(); i++) { - SimpleType st = indexToType.get(i); - System.out.println(i + ": " + st.getName() + " subtypes: " + st.getBitSet()); - } - System.out.println(); - } - - /** Tests serialization of simple types, including resolution. */ - public void debugSerialization() throws IOException, ClassNotFoundException { - // test serialization - SimpleType st = indexToType.get(1); - String filename = "tmp.ser"; - ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(filename)); - System.out.println("Writing st: " + st.getIndex() + ": " + st + " " + st.getBitSet()); - out.writeObject(st); - out.close(); - ObjectInputStream in = new ObjectInputStream(new FileInputStream(filename)); - System.out.print("Reading st2: "); - SimpleType st2 = (SimpleType) in.readObject(); - System.out.println(st2.getIndex() + ": " + st2 + " " + st2.getBitSet()); - in.close(); - // test identity (and thus readResolve) - System.out.println("st == st2?: " + (st == st2)); - } -} +/////////////////////////////////////////////////////////////////////////////// +//// Copyright (C) 2003-4 Gunes Erkan and University of Edinburgh (Michael White) +//// +//// This library is free software; you can redistribute it and/or +//// modify it under the terms of the GNU Lesser General Public +//// License as published by the Free Software Foundation; either +//// version 2.1 of the License, or (at your option) any later version. +//// +//// This library is distributed in the hope that it will be useful, +//// but WITHOUT ANY WARRANTY; without even the implied warranty of +//// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//// GNU Lesser General Public License for more details. +//// +//// You should have received a copy of the GNU Lesser General Public +//// License along with this program; if not, write to the Free Software +//// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +//////////////////////////////////////////////////////////////////////////////// + +package opennlp.ccg.grammar; + +import opennlp.ccg.util.*; +import opennlp.ccg.unify.*; + +import org.jdom.*; +import org.jdom.input.*; + +import java.io.*; +import java.net.*; +import java.util.*; + +import gnu.trove.*; + +/** + * Class for constructing and holding the hierarchical simple type maps. + * + * @author Gunes Erkan + * @author Michael White + * @version $Revision: 1.13 $, $Date: 2009/12/21 03:27:18 $ + */ +public class Types implements WithGrammar { + + public Grammar grammar; + private final HashMap nameToType = new HashMap(); + private final ArrayList indexToType = new ArrayList(); + private int maxTypeIndex = 0; + public static final String TOP_TYPE = "top"; + public static final String BOT_TYPE = "bottom"; + + /** Constructor for an empty hierarchy (with just the top type). */ + public Types(){ + getSimpleType(TOP_TYPE); + } + + public Types(Grammar grammar) { + getSimpleType(TOP_TYPE); + this.grammar = grammar; + } + + /** + * Constructs the type hierarchy from the given URL, for + * the given grammar. + */ + @SuppressWarnings("unchecked") + public Types(URL url, Grammar grammar) throws IOException { + this.grammar = grammar; + SAXBuilder builder = new SAXBuilder(); + Document doc; + try { + doc = builder.build(url); + } + catch (JDOMException exc) { + getSimpleType(TOP_TYPE); + throw (IOException) new IOException().initCause(exc); + } + List entries = doc.getRootElement().getChildren(); + readTypes(entries); + // for debugging: print the indexToType list + //printTypes(); + } + + public void setGrammar(Grammar grammar){ + this.grammar = grammar; + } + + /** Returns the simple type with the given name, or a new one if none yet exists. */ + public SimpleType getSimpleType(String typeName) { + SimpleType type = nameToType.get(typeName); + if (type == null) { + BitSet bs = new BitSet(); + bs.set(maxTypeIndex); + SimpleType newtype = new SimpleType(maxTypeIndex, typeName, bs, this); + nameToType.put(typeName, newtype); + indexToType.add(newtype); + nameToType.get(TOP_TYPE).getBitSet().set(maxTypeIndex++); + return newtype; + } + else return type; + } + + /** Returns whether there is a simple type with the given name. */ + public boolean containsSimpleType(String typeName) { + return nameToType.containsKey(typeName); + } + + /** Returns the list of types, with parents preceding children in the hierarchy. */ + public ArrayList getIndexMap() { + return indexToType; + } + + + /** Reads the rules and constructs the nameToType and indexToType maps. */ + private void readTypes(List _types) { + + GroupMap hierarchy = new GroupMap(); // map from types to all subtypes + GroupMap parents = new GroupMap(); // map from types to parents + TObjectIntHashMap depthMap = new TObjectIntHashMap(); // map from types to max depth + + // Construct the initial hierarchy of types without + // taking transitive closure. + // Also store parents. + for (int i=0; i < _types.size(); i++) { + Element typeEl = _types.get(i); + String typeName = typeEl.getAttributeValue("name"); + String _parents = typeEl.getAttributeValue("parents"); + hierarchy.put(typeName, BOT_TYPE); + if (_parents == null) { + hierarchy.put(TOP_TYPE, typeName); + parents.put(typeName, TOP_TYPE); + } + else { + String[] parentsArray = _parents.split("\\s+"); + for (int j = 0; j < parentsArray.length; j++) { + hierarchy.put(parentsArray[j], typeName); + parents.put(typeName, parentsArray[j]); + } + } + } + + // Compute depth from parents. + for (String type : parents.keySet()) { + int depth = computeDepth(type, parents, type); + depthMap.put(type, depth); + } + + // Compute ALL subtypes of each type and insert into the hierarchy. + for (String type : hierarchy.keySet()) { + hierarchy.putAll(type, findAllSubtypes(hierarchy, type)); + } + + // Assign a unique int to each type in breadth-first order. + // Then create the string -> SimpleType map. + createSimpleTypes(hierarchy, depthMap); + } + + /** Returns the max depth of the given type, checking for cycles. */ + private static int computeDepth(String type, GroupMap parents, String startType) { + if (type.equals(TOP_TYPE)) return 0; + int maxParentDepth = 0; + Set parentSet = parents.get(type); + if (parentSet != null) { + for (String parent : parentSet) { + if (parent.equals(startType)) { + throw new RuntimeException("Error, type hierarchy contains cycle from/to: " + startType); + } + int parentDepth = computeDepth(parent, parents, startType); + maxParentDepth = Math.max(maxParentDepth, parentDepth); + } + } + return maxParentDepth + 1; + } + + /** + * Computes the list of all sub-types of a given type (key) + * in depth-first order. + */ + private Collection findAllSubtypes(GroupMap hierarchy, String key) { + ArrayList subs = new ArrayList(); + if (hierarchy.get(key) != null) { + Stack look = new Stack(); + for (String type : hierarchy.get(key)) { + look.push(type); + } + for (; !look.empty() ; ) { + String new_sub = look.pop(); + subs.add(new_sub); + if (hierarchy.get(new_sub) != null) { + for (String type : hierarchy.get(new_sub)) { + look.push(type); + } + } + } + } + return subs; + } + + /** + * Creates the SimpleType objects and constructs the nameToType and indexToType maps. + */ + private void createSimpleTypes(GroupMap hierarchy, TObjectIntHashMap depthMap) { + + // find max depth + int maxDepth = 0; + int[] depths = depthMap.getValues(); + for (int i = 0; i < depths.length; i++) { + maxDepth = Math.max(maxDepth, depths[i]); + } + + // add types in order of increasing depth + ArrayList typesVisited = new ArrayList(); + typesVisited.add(TOP_TYPE); + Object[] types = depthMap.keys(); + ArrayList typesAtSameDepth = new ArrayList(); + for (int i = 1; i <= maxDepth; i++) { + typesAtSameDepth.clear(); + for (int j = 0; j < types.length; j++) { + if (depthMap.get(types[j]) == i) + typesAtSameDepth.add((String)types[j]); + } + Collections.sort(typesAtSameDepth); + typesVisited.addAll(typesAtSameDepth); + } + + // construct the maps + for (int i=0; i < typesVisited.size(); i++) { + String typeName = typesVisited.get(i); + BitSet bitset = new BitSet(); + bitset.set(i); + if (hierarchy.get(typeName) != null) { + for (String type : hierarchy.get(typeName)) { + int indexToSet = typesVisited.indexOf(type); + if (indexToSet != -1) bitset.set(indexToSet); + } + } + SimpleType st = new SimpleType(i, typeName, bitset, this); + nameToType.put(typeName, st); + indexToType.add(st); + } + maxTypeIndex = typesVisited.size(); + } + + /** + * Prints the types and their subtypes to System.out. + */ + public void printTypes() { + System.out.println("types:"); + for (int i=0; i < indexToType.size(); i++) { + SimpleType st = indexToType.get(i); + System.out.println(i + ": " + st.getName() + " subtypes: " + st.getBitSet()); + } + System.out.println(); + } + + /** Tests serialization of simple types, including resolution. */ + public void debugSerialization() throws IOException, ClassNotFoundException { + // test serialization + SimpleType st = indexToType.get(1); + String filename = "tmp.ser"; + ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(filename)); + System.out.println("Writing st: " + st.getIndex() + ": " + st + " " + st.getBitSet()); + out.writeObject(st); + out.close(); + ObjectInputStream in = new ObjectInputStream(new FileInputStream(filename)); + System.out.print("Reading st2: "); + SimpleType st2 = (SimpleType) in.readObject(); + System.out.println(st2.getIndex() + ": " + st2 + " " + st2.getBitSet()); + in.close(); + // test identity (and thus readResolve) + System.out.println("st == st2?: " + (st == st2)); + } +} diff --git a/src/opennlp/ccg/grammar/WithGrammar.java b/src/opennlp/ccg/grammar/WithGrammar.java new file mode 100644 index 0000000..ce34094 --- /dev/null +++ b/src/opennlp/ccg/grammar/WithGrammar.java @@ -0,0 +1,5 @@ +package opennlp.ccg.grammar; + +public interface WithGrammar { + public void setGrammar(Grammar grammar); +} diff --git a/src/opennlp/ccg/lexicon/Lexicon.java b/src/opennlp/ccg/lexicon/Lexicon.java index 6cafebb..bdf4615 100644 --- a/src/opennlp/ccg/lexicon/Lexicon.java +++ b/src/opennlp/ccg/lexicon/Lexicon.java @@ -44,7 +44,7 @@ * @author Michael White * @version $Revision: 1.78 $, $Date: 2011/10/31 02:01:06 $ */ -public class Lexicon { +public class Lexicon implements WithGrammar { /** Flag used to indicate a purely syntactic edge, with no associated semantics. */ public static final String NO_SEM_FLAG = "*NoSem*"; @@ -88,7 +88,7 @@ public class Lexicon { private Interner lookupCache = new Interner(true); /** The grammar that this lexicon is part of. */ - public final Grammar grammar; + public Grammar grammar; /** The tokenizer. (Defaults to DefaultTokenizer.) */ public final Tokenizer tokenizer; @@ -103,6 +103,10 @@ public class Lexicon { /************************************************************* * Constructor *************************************************************/ + public Lexicon(){ + this.tokenizer = new DefaultTokenizer(); + } + public Lexicon(Grammar grammar) { this.grammar = grammar; this.tokenizer = new DefaultTokenizer(); @@ -118,6 +122,10 @@ public Lexicon(Grammar grammar, Tokenizer tokenizer) { /** Sets the supertagger (null if none). */ public void setSupertagger(SupertaggerAdapter supertagger) { _supertagger = supertagger; } + + public void setGrammar(Grammar grammar){ + this.grammar = grammar; + } /** Loads the lexicon and morph files. */ From 74858d426824406c788c954ec58e81933c745760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Navickas?= Date: Fri, 12 Jul 2019 15:25:47 +0300 Subject: [PATCH 03/28] Basic builders --- src/opennlp/ccg/grammar/Grammar.java | 19 +++++++- .../ccg/grammar/builders/GrammarBuilder.java | 45 +++++++++++++++++++ .../ccg/grammar/builders/LexiconBuilder.java | 18 ++++++++ .../ccg/grammar/builders/RulesBuilder.java | 18 ++++++++ .../ccg/grammar/builders/TypesBuilder.java | 17 +++++++ 5 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 src/opennlp/ccg/grammar/builders/GrammarBuilder.java create mode 100644 src/opennlp/ccg/grammar/builders/LexiconBuilder.java create mode 100644 src/opennlp/ccg/grammar/builders/RulesBuilder.java create mode 100644 src/opennlp/ccg/grammar/builders/TypesBuilder.java diff --git a/src/opennlp/ccg/grammar/Grammar.java b/src/opennlp/ccg/grammar/Grammar.java index 61858a7..25501bf 100644 --- a/src/opennlp/ccg/grammar/Grammar.java +++ b/src/opennlp/ccg/grammar/Grammar.java @@ -109,7 +109,24 @@ public class Grammar { }; // set of boundary tones - private static Set boundaryTonesSet = null; + private static Set boundaryTonesSet = null; + + public Grammar(){ + this.fromXmlTransforms = new URL[0]; + this.toXmlTransforms = new URL[0]; + } + + public void setTypes(Types types){ + this.types = types; + } + + public void setLexicon(Lexicon lexicon){ + this.lexicon = lexicon; + } + + public void setRules(RuleGroup rules){ + this.rules = rules; + } /** Loads a grammar from the given filename. */ diff --git a/src/opennlp/ccg/grammar/builders/GrammarBuilder.java b/src/opennlp/ccg/grammar/builders/GrammarBuilder.java new file mode 100644 index 0000000..b5db1ac --- /dev/null +++ b/src/opennlp/ccg/grammar/builders/GrammarBuilder.java @@ -0,0 +1,45 @@ +package opennlp.ccg.grammar.builders; + +import opennlp.ccg.grammar.Grammar; +import opennlp.ccg.grammar.RuleGroup; +import opennlp.ccg.grammar.Types; +import opennlp.ccg.lexicon.Lexicon; + +public class GrammarBuilder { + public static GrammarBuilder builder(){ + return new GrammarBuilder(); + } + + private Grammar grammar; + + private GrammarBuilder(){ + this.grammar = new Grammar(); + } + + public GrammarBuilder withTypes(Types types){ + this.grammar.setTypes(types); + types.setGrammar(this.grammar); + return this; + } + + public GrammarBuilder withLexicon(Lexicon lexicon){ + this.grammar.setLexicon(lexicon); + lexicon.setGrammar(this.grammar); + return this; + } + + public GrammarBuilder withRules(RuleGroup rules){ + this.grammar.setRules(rules); + rules.setGrammar(this.grammar); + return this; + } + + public Grammar build(){ + // Check if we added everything + assert this.grammar.lexicon != null; + assert this.grammar.rules != null; + assert this.grammar.types != null; + + return this.grammar; + } +} diff --git a/src/opennlp/ccg/grammar/builders/LexiconBuilder.java b/src/opennlp/ccg/grammar/builders/LexiconBuilder.java new file mode 100644 index 0000000..72f2e1c --- /dev/null +++ b/src/opennlp/ccg/grammar/builders/LexiconBuilder.java @@ -0,0 +1,18 @@ +package opennlp.ccg.grammar.builders; + +import opennlp.ccg.lexicon.Lexicon; + +public class LexiconBuilder { + public static LexiconBuilder builder(){ + return new LexiconBuilder(); + } + + private Lexicon lexicon; + private LexiconBuilder(){ + this.lexicon = new Lexicon(); + } + + public Lexicon build(){ + return this.lexicon; + } +} diff --git a/src/opennlp/ccg/grammar/builders/RulesBuilder.java b/src/opennlp/ccg/grammar/builders/RulesBuilder.java new file mode 100644 index 0000000..fe05dbf --- /dev/null +++ b/src/opennlp/ccg/grammar/builders/RulesBuilder.java @@ -0,0 +1,18 @@ +package opennlp.ccg.grammar.builders; + +import opennlp.ccg.grammar.RuleGroup; + +public class RulesBuilder { + public static RulesBuilder builder(){ + return new RulesBuilder(); + } + + private RuleGroup rules; + private RulesBuilder(){ + this.rules = new RuleGroup(); + } + + public RuleGroup build(){ + return this.rules; + } +} diff --git a/src/opennlp/ccg/grammar/builders/TypesBuilder.java b/src/opennlp/ccg/grammar/builders/TypesBuilder.java new file mode 100644 index 0000000..17bd2c0 --- /dev/null +++ b/src/opennlp/ccg/grammar/builders/TypesBuilder.java @@ -0,0 +1,17 @@ +package opennlp.ccg.grammar.builders; + +import opennlp.ccg.grammar.Types; + +public class TypesBuilder { + public static TypesBuilder builder(){ + return new TypesBuilder(); + } + + private TypesBuilder(){ + + } + + public Types build(){ + return new Types(); + } +} From 88f76271bcbe7f43ed75d91a1c0b65ce97b0fa8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Navickas?= Date: Fri, 12 Jul 2019 15:32:27 +0300 Subject: [PATCH 04/28] Split Lexicon init --- src/opennlp/ccg/lexicon/Lexicon.java | 76 ++++++++++++++-------------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/src/opennlp/ccg/lexicon/Lexicon.java b/src/opennlp/ccg/lexicon/Lexicon.java index bdf4615..4574437 100644 --- a/src/opennlp/ccg/lexicon/Lexicon.java +++ b/src/opennlp/ccg/lexicon/Lexicon.java @@ -127,19 +127,7 @@ public void setGrammar(Grammar grammar){ this.grammar = grammar; } - - /** Loads the lexicon and morph files. */ - public void init(URL lexiconUrl, URL morphUrl) throws IOException { - - List lexicon = null; - List morph = null; - List macroModel = null; - - // load category families (lexicon), morph forms and macros - lexicon = getLexicon(lexiconUrl); - Pair,List> morphInfo = getMorph(morphUrl); - morph = morphInfo.a; macroModel = morphInfo.b; - + public void init(List lexicon, List morph, List macroModel){ // index words; also index stems to words, as default preds // store indexed coarticulation attrs too _words = new GroupMap(); @@ -156,7 +144,7 @@ public void init(URL lexiconUrl, URL morphUrl) throws IOException { Pair first = indexingWord.getSurfaceAttrValPairs().next(); _indexedCoartAttrs.add(first.a); for (Iterator> it = surfaceWord.getSurfaceAttrValPairs(); it.hasNext(); ) { - Pair p = it.next(); + Pair p = it.next(); _coartAttrs.add(p.a); } } @@ -170,16 +158,16 @@ public void init(URL lexiconUrl, URL morphUrl) throws IOException { // also index rels and coart rels to preds _relsToPreds = new GroupMap(); _coartRelsToPreds = new GroupMap(); - // and gather list of attributes used per atomic category type + // and gather list of attributes used per atomic category type _catsToAttrs = new GroupMap(); _lfAttrs = new HashSet(); // and remember family and ent, names, for checking excluded list on morph items HashSet familyAndEntryNames = new HashSet(); - + // index each family for (Family family : lexicon) { - familyAndEntryNames.add(family.getName()); + familyAndEntryNames.add(family.getName()); EntriesItem[] entries = family.getEntries(); DataItem[] data = family.getData(); @@ -193,7 +181,7 @@ public void init(URL lexiconUrl, URL morphUrl) throws IOException { for (int j=0; j < entries.length; j++) { // index EntriesItem eItem = entries[j]; - _stagToEntries.put(eItem.getSupertag()+family.getPOS(), eItem); + _stagToEntries.put(eItem.getSupertag()+family.getPOS(), eItem); if (eItem.getStem().length() > 0) { _stems.put(eItem.getStem()+family.getPOS(), eItem); } @@ -217,10 +205,10 @@ public void init(URL lexiconUrl, URL morphUrl) throws IOException { if (!dItem.getStem().equals(dItem.getPred())) { Collection words = (Collection) _predToWords.get(dItem.getStem()); if (words == null) { - if (!openlex) { - System.out.print("Warning: couldn't find words for pred '"); - System.out.println(dItem.getPred() + "' with stem '" + dItem.getStem() + "'"); - } + if (!openlex) { + System.out.print("Warning: couldn't find words for pred '"); + System.out.println(dItem.getPred() + "' with stem '" + dItem.getStem() + "'"); + } } else { for (Iterator it = words.iterator(); it.hasNext(); ) { @@ -231,12 +219,12 @@ public void init(URL lexiconUrl, URL morphUrl) throws IOException { } // index rels to preds - // nb: this covers relational (eg @xe) and featural (eg @epast) + // nb: this covers relational (eg @xe) and featural (eg @epast) // elementary predications List indexRels = new ArrayList(3); String familyIndexRel = family.getIndexRel(); - if (familyIndexRel.length() > 0) { - indexRels.add(familyIndexRel); + if (familyIndexRel.length() > 0) { + indexRels.add(familyIndexRel); } for (int j=0; j < entries.length; j++) { EntriesItem eItem = entries[j]; @@ -247,13 +235,13 @@ public void init(URL lexiconUrl, URL morphUrl) throws IOException { } for (Iterator it = indexRels.iterator(); it.hasNext(); ) { String indexRel = it.next(); - // nb: not indexing on entries items, b/c some stems are still defaults + // nb: not indexing on entries items, b/c some stems are still defaults for (int j=0; j < data.length; j++) { DataItem dItem = data[j]; _relsToPreds.put(indexRel, dItem.getPred()); } } - + // index coart rels (features, really) to preds String coartRel = family.getCoartRel(); if (coartRel.length() > 0) { @@ -281,32 +269,46 @@ public void init(URL lexiconUrl, URL morphUrl) throws IOException { // with morph items, check POS, macro names, excluded list for xref for (MorphItem morphItem : morph) { Word w = morphItem.getWord(); - if (!openlex && - !_stems.containsKey(w.getStem() + w.getPOS()) && - !_posToEntries.containsKey(w.getPOS())) + if (!openlex && + !_stems.containsKey(w.getStem() + w.getPOS()) && + !_posToEntries.containsKey(w.getPOS())) { System.err.println( - "Warning: no entries for stem '" + w.getStem() + - "' and POS '" + w.getPOS() + - "' found for word '" + w + "'" + "Warning: no entries for stem '" + w.getStem() + + "' and POS '" + w.getPOS() + + "' found for word '" + w + "'" ); } String[] macroNames = morphItem.getMacros(); for (int j=0; j < macroNames.length; j++) { if (!_macroItems.containsKey(macroNames[j])) { - System.err.println("Warning: macro " + macroNames[j] + - " not found for word '" + morphItem.getWord() + "'"); + System.err.println("Warning: macro " + macroNames[j] + + " not found for word '" + morphItem.getWord() + "'"); } } String[] excludedNames = morphItem.getExcluded(); for (int j=0; j < excludedNames.length; j++) { if (!familyAndEntryNames.contains(excludedNames[j])) { - System.err.println("Warning: excluded family or entry '" + excludedNames[j] + - "' not found for word '" + morphItem.getWord() + "'"); + System.err.println("Warning: excluded family or entry '" + excludedNames[j] + + "' not found for word '" + morphItem.getWord() + "'"); } } } } + /** Loads the lexicon and morph files. */ + public void init(URL lexiconUrl, URL morphUrl) throws IOException { + + List lexicon = null; + List morph = null; + List macroModel = null; + + // load category families (lexicon), morph forms and macros + lexicon = getLexicon(lexiconUrl); + Pair,List> morphInfo = getMorph(morphUrl); + morph = morphInfo.a; macroModel = morphInfo.b; + + init(lexicon, morph, macroModel); + } /** Expands inheritsFrom links to feature equations for those features not explicitly listed. */ public void expandInheritsFrom(Category cat) { From b0f7d1cc9ac6ad8be5d1ef2abd7649496d676fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Navickas?= Date: Fri, 12 Jul 2019 15:42:27 +0300 Subject: [PATCH 05/28] Improve builders --- src/opennlp/ccg/grammar/builders/RulesBuilder.java | 5 +++++ src/opennlp/ccg/grammar/builders/TypesBuilder.java | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/opennlp/ccg/grammar/builders/RulesBuilder.java b/src/opennlp/ccg/grammar/builders/RulesBuilder.java index fe05dbf..3d4f24e 100644 --- a/src/opennlp/ccg/grammar/builders/RulesBuilder.java +++ b/src/opennlp/ccg/grammar/builders/RulesBuilder.java @@ -1,6 +1,7 @@ package opennlp.ccg.grammar.builders; import opennlp.ccg.grammar.RuleGroup; +import opennlp.ccg.grammar.Rule; public class RulesBuilder { public static RulesBuilder builder(){ @@ -12,6 +13,10 @@ private RulesBuilder(){ this.rules = new RuleGroup(); } + public void addRule(Rule rule){ + this.rules.addRule(rule); + } + public RuleGroup build(){ return this.rules; } diff --git a/src/opennlp/ccg/grammar/builders/TypesBuilder.java b/src/opennlp/ccg/grammar/builders/TypesBuilder.java index 17bd2c0..d4a8934 100644 --- a/src/opennlp/ccg/grammar/builders/TypesBuilder.java +++ b/src/opennlp/ccg/grammar/builders/TypesBuilder.java @@ -7,11 +7,12 @@ public static TypesBuilder builder(){ return new TypesBuilder(); } + private Types types; private TypesBuilder(){ - + this.types = new Types(); } public Types build(){ - return new Types(); + return this.types; } } From 92bbf0b0d87ce511dffb0931f0f2af91612ec3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Navickas?= Date: Fri, 12 Jul 2019 15:51:34 +0300 Subject: [PATCH 06/28] Allow to actually build Lexicon --- .../ccg/grammar/builders/LexiconBuilder.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/opennlp/ccg/grammar/builders/LexiconBuilder.java b/src/opennlp/ccg/grammar/builders/LexiconBuilder.java index 72f2e1c..f23080e 100644 --- a/src/opennlp/ccg/grammar/builders/LexiconBuilder.java +++ b/src/opennlp/ccg/grammar/builders/LexiconBuilder.java @@ -1,6 +1,7 @@ package opennlp.ccg.grammar.builders; -import opennlp.ccg.lexicon.Lexicon; +import opennlp.ccg.lexicon.*; +import java.util.*; public class LexiconBuilder { public static LexiconBuilder builder(){ @@ -8,11 +9,27 @@ public static LexiconBuilder builder(){ } private Lexicon lexicon; + private List familyList = new ArrayList<>(); + private List morphList = new ArrayList<>(); + private List macroList = new ArrayList<>(); private LexiconBuilder(){ this.lexicon = new Lexicon(); } + public void addFamily(Family family){ + this.familyList.add(family); + } + + public void addMorph(MorphItem item){ + this.morphList.add(item); + } + + public void addMacro(MacroItem item){ + this.macroList.add(item); + } + public Lexicon build(){ + this.lexicon.init(familyList, morphList, macroList); return this.lexicon; } } From aca785b9a44bc9ab4017c0da716b405ae3d5508e Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Mon, 15 Jul 2019 14:06:02 +0300 Subject: [PATCH 07/28] Allow to dynamically add type --- src/opennlp/ccg/grammar/Types.java | 2 +- .../ccg/grammar/builders/TypesBuilder.java | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/opennlp/ccg/grammar/Types.java b/src/opennlp/ccg/grammar/Types.java index efd0cbd..c728dd4 100644 --- a/src/opennlp/ccg/grammar/Types.java +++ b/src/opennlp/ccg/grammar/Types.java @@ -109,7 +109,7 @@ public ArrayList getIndexMap() { /** Reads the rules and constructs the nameToType and indexToType maps. */ - private void readTypes(List _types) { + public void readTypes(List _types) { GroupMap hierarchy = new GroupMap(); // map from types to all subtypes GroupMap parents = new GroupMap(); // map from types to parents diff --git a/src/opennlp/ccg/grammar/builders/TypesBuilder.java b/src/opennlp/ccg/grammar/builders/TypesBuilder.java index d4a8934..21f6081 100644 --- a/src/opennlp/ccg/grammar/builders/TypesBuilder.java +++ b/src/opennlp/ccg/grammar/builders/TypesBuilder.java @@ -1,18 +1,35 @@ package opennlp.ccg.grammar.builders; import opennlp.ccg.grammar.Types; +import org.jdom.Element; + +import java.util.ArrayList; +import java.util.List; public class TypesBuilder { public static TypesBuilder builder(){ return new TypesBuilder(); } + private List elementList = new ArrayList<>(); private Types types; private TypesBuilder(){ this.types = new Types(); } + public TypesBuilder addType(String name){ + return addType(name, ""); + } + + public TypesBuilder addType(String name, String parents){ + Element el = new Element("type"); + el.setAttribute("name", name); + el.setAttribute("parents", parents); + return this; + } + public Types build(){ + this.types.readTypes(this.elementList); return this.types; } } From d4f0bb6ad75cbcef09eb7edb1f8bf3b880661d9c Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Mon, 15 Jul 2019 14:22:31 +0300 Subject: [PATCH 08/28] Fix other builders --- src/opennlp/ccg/grammar/builders/LexiconBuilder.java | 9 ++++++--- src/opennlp/ccg/grammar/builders/RulesBuilder.java | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/opennlp/ccg/grammar/builders/LexiconBuilder.java b/src/opennlp/ccg/grammar/builders/LexiconBuilder.java index f23080e..1a8ee45 100644 --- a/src/opennlp/ccg/grammar/builders/LexiconBuilder.java +++ b/src/opennlp/ccg/grammar/builders/LexiconBuilder.java @@ -16,16 +16,19 @@ private LexiconBuilder(){ this.lexicon = new Lexicon(); } - public void addFamily(Family family){ + public LexiconBuilder addFamily(Family family){ this.familyList.add(family); + return this; } - public void addMorph(MorphItem item){ + public LexiconBuilder addMorph(MorphItem item){ this.morphList.add(item); + return this; } - public void addMacro(MacroItem item){ + public LexiconBuilder addMacro(MacroItem item){ this.macroList.add(item); + return this; } public Lexicon build(){ diff --git a/src/opennlp/ccg/grammar/builders/RulesBuilder.java b/src/opennlp/ccg/grammar/builders/RulesBuilder.java index 3d4f24e..389ad6a 100644 --- a/src/opennlp/ccg/grammar/builders/RulesBuilder.java +++ b/src/opennlp/ccg/grammar/builders/RulesBuilder.java @@ -13,8 +13,9 @@ private RulesBuilder(){ this.rules = new RuleGroup(); } - public void addRule(Rule rule){ + public RulesBuilder addRule(Rule rule){ this.rules.addRule(rule); + return this; } public RuleGroup build(){ From d1deefc829723f56455338208f6feb77138a7583 Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Wed, 17 Jul 2019 14:03:17 +0300 Subject: [PATCH 09/28] Some hacks --- src/opennlp/ccg/grammar/Grammar.java | 1 + src/opennlp/ccg/grammar/builders/GrammarBuilder.java | 4 ++++ src/opennlp/ccg/lexicon/Lexicon.java | 3 +++ 3 files changed, 8 insertions(+) diff --git a/src/opennlp/ccg/grammar/Grammar.java b/src/opennlp/ccg/grammar/Grammar.java index 25501bf..dcb06cc 100644 --- a/src/opennlp/ccg/grammar/Grammar.java +++ b/src/opennlp/ccg/grammar/Grammar.java @@ -112,6 +112,7 @@ public class Grammar { private static Set boundaryTonesSet = null; public Grammar(){ + theGrammar = this; this.fromXmlTransforms = new URL[0]; this.toXmlTransforms = new URL[0]; } diff --git a/src/opennlp/ccg/grammar/builders/GrammarBuilder.java b/src/opennlp/ccg/grammar/builders/GrammarBuilder.java index b5db1ac..7024ceb 100644 --- a/src/opennlp/ccg/grammar/builders/GrammarBuilder.java +++ b/src/opennlp/ccg/grammar/builders/GrammarBuilder.java @@ -16,6 +16,10 @@ private GrammarBuilder(){ this.grammar = new Grammar(); } + public boolean isGlobalGrammarInit(){ + return this.grammar.theGrammar != null; + } + public GrammarBuilder withTypes(Types types){ this.grammar.setTypes(types); types.setGrammar(this.grammar); diff --git a/src/opennlp/ccg/lexicon/Lexicon.java b/src/opennlp/ccg/lexicon/Lexicon.java index 4574437..7da3bab 100644 --- a/src/opennlp/ccg/lexicon/Lexicon.java +++ b/src/opennlp/ccg/lexicon/Lexicon.java @@ -105,6 +105,9 @@ public class Lexicon implements WithGrammar { *************************************************************/ public Lexicon(){ this.tokenizer = new DefaultTokenizer(); + Grammar.theGrammar.lexicon = this; + loadLicensingFeatures(null); + loadRelationSortOrder(null); } public Lexicon(Grammar grammar) { From 801bfb3f171434ac54918d2ee246e64fd5ccea08 Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Wed, 17 Jul 2019 16:15:27 +0300 Subject: [PATCH 10/28] Allow empty type --- src/opennlp/ccg/grammar/builders/TypesBuilder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/opennlp/ccg/grammar/builders/TypesBuilder.java b/src/opennlp/ccg/grammar/builders/TypesBuilder.java index 21f6081..b599fd3 100644 --- a/src/opennlp/ccg/grammar/builders/TypesBuilder.java +++ b/src/opennlp/ccg/grammar/builders/TypesBuilder.java @@ -18,7 +18,9 @@ private TypesBuilder(){ } public TypesBuilder addType(String name){ - return addType(name, ""); + Element el = new Element("type"); + el.setAttribute("name", name); + return this; } public TypesBuilder addType(String name, String parents){ From e73d068514104ce16e25728a91ab165c0e8879d4 Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Thu, 18 Jul 2019 15:59:05 +0300 Subject: [PATCH 11/28] Some tweaks --- src/opennlp/ccg/grammar/Types.java | 3 +-- src/opennlp/ccg/grammar/builders/TypesBuilder.java | 2 ++ src/opennlp/ccg/lexicon/Lexicon.java | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/opennlp/ccg/grammar/Types.java b/src/opennlp/ccg/grammar/Types.java index c728dd4..c19ae14 100644 --- a/src/opennlp/ccg/grammar/Types.java +++ b/src/opennlp/ccg/grammar/Types.java @@ -48,7 +48,6 @@ public class Types implements WithGrammar { /** Constructor for an empty hierarchy (with just the top type). */ public Types(){ - getSimpleType(TOP_TYPE); } public Types(Grammar grammar) { @@ -75,7 +74,7 @@ public Types(URL url, Grammar grammar) throws IOException { List entries = doc.getRootElement().getChildren(); readTypes(entries); // for debugging: print the indexToType list - //printTypes(); + // printTypes(); } public void setGrammar(Grammar grammar){ diff --git a/src/opennlp/ccg/grammar/builders/TypesBuilder.java b/src/opennlp/ccg/grammar/builders/TypesBuilder.java index b599fd3..cb0773d 100644 --- a/src/opennlp/ccg/grammar/builders/TypesBuilder.java +++ b/src/opennlp/ccg/grammar/builders/TypesBuilder.java @@ -20,6 +20,7 @@ private TypesBuilder(){ public TypesBuilder addType(String name){ Element el = new Element("type"); el.setAttribute("name", name); + elementList.add(el); return this; } @@ -27,6 +28,7 @@ public TypesBuilder addType(String name, String parents){ Element el = new Element("type"); el.setAttribute("name", name); el.setAttribute("parents", parents); + elementList.add(el); return this; } diff --git a/src/opennlp/ccg/lexicon/Lexicon.java b/src/opennlp/ccg/lexicon/Lexicon.java index 7da3bab..f81ba5b 100644 --- a/src/opennlp/ccg/lexicon/Lexicon.java +++ b/src/opennlp/ccg/lexicon/Lexicon.java @@ -1322,4 +1322,8 @@ private void loadRelationSortOrder(Element relationSortingElt) { public GroupMap getWords() { return _words; } + + public GroupMap getMacros(){ + return _macros; + } } From fe26eb7e7682a47c932d4148edc4c1c5ba5d1a8b Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Wed, 31 Jul 2019 08:28:49 +0300 Subject: [PATCH 12/28] Some tweaks --- src/openccg.iml | 24 +++++++++++++ src/opennlp/ccg/ccg-core.iml | 35 +++++++++++++++++++ .../ccg/grammar/builders/LexiconBuilder.java | 4 +++ src/opennlp/ccg/hylo/HyloHelper.java | 1 + src/opennlp/ccgbank/ccgbank.iml | 26 ++++++++++++++ src/opennlp/openccg.iml | 23 ++++++++++++ 6 files changed, 113 insertions(+) create mode 100644 src/openccg.iml create mode 100644 src/opennlp/ccg/ccg-core.iml create mode 100644 src/opennlp/ccgbank/ccgbank.iml create mode 100644 src/opennlp/openccg.iml diff --git a/src/openccg.iml b/src/openccg.iml new file mode 100644 index 0000000..c89133e --- /dev/null +++ b/src/openccg.iml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/opennlp/ccg/ccg-core.iml b/src/opennlp/ccg/ccg-core.iml new file mode 100644 index 0000000..3ebd926 --- /dev/null +++ b/src/opennlp/ccg/ccg-core.iml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/opennlp/ccg/grammar/builders/LexiconBuilder.java b/src/opennlp/ccg/grammar/builders/LexiconBuilder.java index 1a8ee45..e414827 100644 --- a/src/opennlp/ccg/grammar/builders/LexiconBuilder.java +++ b/src/opennlp/ccg/grammar/builders/LexiconBuilder.java @@ -31,6 +31,10 @@ public LexiconBuilder addMacro(MacroItem item){ return this; } + public Lexicon ref(){ + return this.lexicon; + } + public Lexicon build(){ this.lexicon.init(familyList, morphList, macroList); return this.lexicon; diff --git a/src/opennlp/ccg/hylo/HyloHelper.java b/src/opennlp/ccg/hylo/HyloHelper.java index f57d697..877eae4 100644 --- a/src/opennlp/ccg/hylo/HyloHelper.java +++ b/src/opennlp/ccg/hylo/HyloHelper.java @@ -660,6 +660,7 @@ public int compare(LF lf1, LF lf2){ String rel1 = getRel(lf1); String rel2 = getRel(lf2); Lexicon theLexicon = Grammar.theGrammar.lexicon; + assert theLexicon != null; Integer rel1Index = theLexicon.getRelationSortIndex(rel1); Integer rel2Index = theLexicon.getRelationSortIndex(rel2); int relIndexCompare = rel1Index.compareTo(rel2Index); diff --git a/src/opennlp/ccgbank/ccgbank.iml b/src/opennlp/ccgbank/ccgbank.iml new file mode 100644 index 0000000..34a671a --- /dev/null +++ b/src/opennlp/ccgbank/ccgbank.iml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/opennlp/openccg.iml b/src/opennlp/openccg.iml new file mode 100644 index 0000000..1da446c --- /dev/null +++ b/src/opennlp/openccg.iml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 8afa257ace81e2e2797b32ffbf01ff5b67b3c72b Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Wed, 11 Sep 2019 11:24:11 +0300 Subject: [PATCH 13/28] Add Makefile and update version --- Makefile | 2 ++ pom.xml | 2 +- src/pom.xml | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..980f6fc --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +package: + mvn package diff --git a/pom.xml b/pom.xml index cf80c5a..d9a922b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 opennlp ccg - 0.10.0 + 0.10.1-wo-xml pom diff --git a/src/pom.xml b/src/pom.xml index 4d905e4..3ae666b 100644 --- a/src/pom.xml +++ b/src/pom.xml @@ -4,8 +4,8 @@ 4.0.0 opennlp openccg - 0.10.0 - + 0.10.1-wo-xml + 1.8 1.8 From 09832b70702217df0a6d2e70db647774767aa776 Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Wed, 11 Sep 2019 13:37:24 +0300 Subject: [PATCH 14/28] Don't want InteliJJ project files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6383c12..4acaff3 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ lib/openccg.jar output/ src/ccg2xml/ccg2xml.py src/srilmbridge/*.h +*.iml From f8a28dd5524c30aedddc56b16dc1399ad7f82c25 Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Wed, 11 Sep 2019 13:37:58 +0300 Subject: [PATCH 15/28] More stuff to ignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 4acaff3..1b6d489 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,5 @@ output/ src/ccg2xml/ccg2xml.py src/srilmbridge/*.h *.iml +.idea/ +target/ From ec8f657dccd12aed8290cbd7fdd8e226805788af Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Wed, 11 Sep 2019 13:39:45 +0300 Subject: [PATCH 16/28] Remove project config stuff --- src/openccg.iml | 24 ------------------------ src/opennlp/openccg.iml | 23 ----------------------- 2 files changed, 47 deletions(-) delete mode 100644 src/openccg.iml delete mode 100644 src/opennlp/openccg.iml diff --git a/src/openccg.iml b/src/openccg.iml deleted file mode 100644 index c89133e..0000000 --- a/src/openccg.iml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/opennlp/openccg.iml b/src/opennlp/openccg.iml deleted file mode 100644 index 1da446c..0000000 --- a/src/opennlp/openccg.iml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 25074dc0b07fdbc7b07779a6309f56c47055e266 Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Wed, 11 Sep 2019 13:40:34 +0300 Subject: [PATCH 17/28] Don't need this postfix on version --- pom.xml | 2 +- src/pom.xml | 26 +------------------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/pom.xml b/pom.xml index d9a922b..72c2252 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 opennlp ccg - 0.10.1-wo-xml + 0.10.1 pom diff --git a/src/pom.xml b/src/pom.xml index 3ae666b..2bec217 100644 --- a/src/pom.xml +++ b/src/pom.xml @@ -4,7 +4,7 @@ 4.0.0 opennlp openccg - 0.10.1-wo-xml + 0.10.1 1.8 @@ -127,30 +127,6 @@ - From 50b4a2d6c21b9d1795106485694cb14dd0a3df54 Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Wed, 11 Sep 2019 13:44:49 +0300 Subject: [PATCH 18/28] Atleast a simple mention of maven --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 0f1214c..947166b 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,11 @@ This release also includes a broad English coverage grammar from the CCGBank and * Version 1.6 or later of the Java 2 SDK (http://java.sun.com) * For ccg2xml and other tools, Python version 2.4 to 2.7 (http://www.python.org) +# Using Maven +*****NOTE** maven will take care dependency downloading step for you, hence steps bellow can be ignored + +All of the standard maven usage rules applies, to simply make `jar` you can do `mvn package`, if you're using GNU Make, can do `make package`. +The result is `openccg.jar` which can be found on `src/target` dir. # Libraries From dd18e1eaa425665c3708138f03de99ebf5d40f23 Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Wed, 11 Sep 2019 13:46:01 +0300 Subject: [PATCH 19/28] Move to different package --- src/opennlp/ccg/{grammar => }/builders/GrammarBuilder.java | 2 +- src/opennlp/ccg/{grammar => }/builders/LexiconBuilder.java | 2 +- src/opennlp/ccg/{grammar => }/builders/RulesBuilder.java | 2 +- src/opennlp/ccg/{grammar => }/builders/TypesBuilder.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename src/opennlp/ccg/{grammar => }/builders/GrammarBuilder.java (96%) rename src/opennlp/ccg/{grammar => }/builders/LexiconBuilder.java (96%) rename src/opennlp/ccg/{grammar => }/builders/RulesBuilder.java (92%) rename src/opennlp/ccg/{grammar => }/builders/TypesBuilder.java (96%) diff --git a/src/opennlp/ccg/grammar/builders/GrammarBuilder.java b/src/opennlp/ccg/builders/GrammarBuilder.java similarity index 96% rename from src/opennlp/ccg/grammar/builders/GrammarBuilder.java rename to src/opennlp/ccg/builders/GrammarBuilder.java index 7024ceb..2cced1b 100644 --- a/src/opennlp/ccg/grammar/builders/GrammarBuilder.java +++ b/src/opennlp/ccg/builders/GrammarBuilder.java @@ -1,4 +1,4 @@ -package opennlp.ccg.grammar.builders; +package opennlp.ccg.builders; import opennlp.ccg.grammar.Grammar; import opennlp.ccg.grammar.RuleGroup; diff --git a/src/opennlp/ccg/grammar/builders/LexiconBuilder.java b/src/opennlp/ccg/builders/LexiconBuilder.java similarity index 96% rename from src/opennlp/ccg/grammar/builders/LexiconBuilder.java rename to src/opennlp/ccg/builders/LexiconBuilder.java index e414827..fe6d0c1 100644 --- a/src/opennlp/ccg/grammar/builders/LexiconBuilder.java +++ b/src/opennlp/ccg/builders/LexiconBuilder.java @@ -1,4 +1,4 @@ -package opennlp.ccg.grammar.builders; +package opennlp.ccg.builders; import opennlp.ccg.lexicon.*; import java.util.*; diff --git a/src/opennlp/ccg/grammar/builders/RulesBuilder.java b/src/opennlp/ccg/builders/RulesBuilder.java similarity index 92% rename from src/opennlp/ccg/grammar/builders/RulesBuilder.java rename to src/opennlp/ccg/builders/RulesBuilder.java index 389ad6a..392f1cd 100644 --- a/src/opennlp/ccg/grammar/builders/RulesBuilder.java +++ b/src/opennlp/ccg/builders/RulesBuilder.java @@ -1,4 +1,4 @@ -package opennlp.ccg.grammar.builders; +package opennlp.ccg.builders; import opennlp.ccg.grammar.RuleGroup; import opennlp.ccg.grammar.Rule; diff --git a/src/opennlp/ccg/grammar/builders/TypesBuilder.java b/src/opennlp/ccg/builders/TypesBuilder.java similarity index 96% rename from src/opennlp/ccg/grammar/builders/TypesBuilder.java rename to src/opennlp/ccg/builders/TypesBuilder.java index cb0773d..0b6edd8 100644 --- a/src/opennlp/ccg/grammar/builders/TypesBuilder.java +++ b/src/opennlp/ccg/builders/TypesBuilder.java @@ -1,4 +1,4 @@ -package opennlp.ccg.grammar.builders; +package opennlp.ccg.builders; import opennlp.ccg.grammar.Types; import org.jdom.Element; From 5eff44d55d79530ae797e13d6031496984c71ba2 Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Wed, 11 Sep 2019 13:47:06 +0300 Subject: [PATCH 20/28] More *.imls removed --- src/opennlp/ccg/ccg-core.iml | 35 --------------------------------- src/opennlp/ccgbank/ccgbank.iml | 26 ------------------------ 2 files changed, 61 deletions(-) delete mode 100644 src/opennlp/ccg/ccg-core.iml delete mode 100644 src/opennlp/ccgbank/ccgbank.iml diff --git a/src/opennlp/ccg/ccg-core.iml b/src/opennlp/ccg/ccg-core.iml deleted file mode 100644 index 3ebd926..0000000 --- a/src/opennlp/ccg/ccg-core.iml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/opennlp/ccgbank/ccgbank.iml b/src/opennlp/ccgbank/ccgbank.iml deleted file mode 100644 index 34a671a..0000000 --- a/src/opennlp/ccgbank/ccgbank.iml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From a15fcfb60efdf869f6b033cec07ae1be922046b6 Mon Sep 17 00:00:00 2001 From: Sarunas Navickas Date: Thu, 12 Sep 2019 09:27:41 +0300 Subject: [PATCH 21/28] Tweaks to make tests work --- Makefile | 3 +++ README.md | 2 ++ pom.xml | 3 +-- src/pom.xml | 27 ++++++++++++++++++++++----- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 980f6fc..478fa92 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,5 @@ package: mvn package + +tests: + mvn test diff --git a/README.md b/README.md index 947166b..d1f8b6c 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ This release also includes a broad English coverage grammar from the CCGBank and All of the standard maven usage rules applies, to simply make `jar` you can do `mvn package`, if you're using GNU Make, can do `make package`. The result is `openccg.jar` which can be found on `src/target` dir. +Tests can be run via `mvn test`, or `make tests` + # Libraries If you're working with the latest source version from GitHub, you'll need to download the external libraries from the latest release, as GitHub discourages including binaries in their repos: diff --git a/pom.xml b/pom.xml index 72c2252..15c79de 100644 --- a/pom.xml +++ b/pom.xml @@ -14,6 +14,5 @@ 1.8 1.8 - - + diff --git a/src/pom.xml b/src/pom.xml index 2bec217..13438d3 100644 --- a/src/pom.xml +++ b/src/pom.xml @@ -13,13 +13,13 @@ - + jdom jdom 1.1 - + trove trove @@ -43,7 +43,7 @@ jopt-simple 3.1 - + junit junit @@ -67,8 +67,9 @@ - openccg - . + openccg + . + ${basedir}/../test maven-compiler-plugin @@ -127,6 +128,22 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M3 + + ${basedir}/../ + + + + org.apache.maven.surefire + surefire-junit47 + 3.0.0-M3 + + + From 63b8859a42558332243b3ef8959b5241501b1dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDygimantas=20Medelis?= Date: Fri, 27 Sep 2019 08:56:14 +0300 Subject: [PATCH 22/28] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 9a0cf2e66052a2c314adee05fad5a1c1ac0169d6 Author: Žygimantas Medelis Date: Fri Sep 27 08:48:23 2019 +0300 [maven-release-plugin] prepare for next development iteration commit 0617aee645f18b6916d3ac722d2a1abb29a839d4 Author: Žygimantas Medelis Date: Fri Sep 27 08:48:13 2019 +0300 [maven-release-plugin] prepare release openccg-0.10.2 commit 5a00b630b180a51519f0444053ecf00579135382 Author: Žygimantas Medelis Date: Fri Sep 27 08:47:52 2019 +0300 release: setup pom to release to clojars commit 3952bb4ea4dfe8c972bc47e8705c36dceafbeeaa Author: Žygimantas Medelis Date: Fri Sep 27 08:44:03 2019 +0300 release: setup pom to release to clojars commit 368fb6b606d10ace81e5ce8ffe33e24b84419a02 Author: Žygimantas Medelis Date: Fri Sep 27 08:40:14 2019 +0300 release: setup pom to release to clojars commit be4b36c161be413b71a933a9cb9202ea7e7d65ad Author: Žygimantas Medelis Date: Fri Sep 27 08:21:18 2019 +0300 release: setup pom to release to clojars commit d606ff01b68bfd58f93beb5a0a45e8622b1b687e Author: Žygimantas Medelis Date: Fri Sep 27 08:09:57 2019 +0300 [maven-release-plugin] prepare for next development iteration commit 775c1130c4f3c515b4ba45ce95a5a575da50a5c3 Author: Žygimantas Medelis Date: Fri Sep 27 08:01:51 2019 +0300 [maven-release-plugin] prepare release openccg-0.10.1 commit 4f598afff8acac746f06b971b0af14a46af5d982 Author: Žygimantas Medelis Date: Fri Sep 27 08:00:54 2019 +0300 release: setup pom to release to clojars commit f76d5c4e703404e7aab58d9e68955eb43f201ae8 Author: Žygimantas Medelis Date: Fri Sep 27 07:54:58 2019 +0300 [maven-release-plugin] prepare release openccg-0.10.1 commit 8ff29d3a2bd3c0f8a842b9e7ac25279e932c6f80 Author: Žygimantas Medelis Date: Fri Sep 27 07:54:18 2019 +0300 release: setup pom to release to clojars commit 9b528cfe1676e67ccea00804c046a77eefaede23 Author: Žygimantas Medelis Date: Fri Sep 27 06:58:24 2019 +0300 [maven-release-plugin] prepare release openccg-0.10.1 commit c780109a70b018aef5e9d800e94bdadb214aa9d8 Author: Žygimantas Medelis Date: Fri Sep 27 06:57:48 2019 +0300 release: setup pom to release to clojars commit 8e805232ae3180072368df3633277b4bb76c22e0 Author: Žygimantas Medelis Date: Fri Sep 27 06:53:16 2019 +0300 [maven-release-plugin] prepare for next development iteration commit 34d2faaa5251e44eb7315e9fd181d5c73ffdf588 Author: Žygimantas Medelis Date: Fri Sep 27 06:53:06 2019 +0300 [maven-release-plugin] prepare release openccg-0.10.0 commit b8dd33575285849b262e320df4212ce559752d5a Author: Žygimantas Medelis Date: Fri Sep 27 06:52:40 2019 +0300 release: setup pom to release to clojars commit f6ca8a65c6e19173a7a0d70f372a1008b36b891d Author: Žygimantas Medelis Date: Fri Sep 27 06:51:04 2019 +0300 [maven-release-plugin] prepare release openccg-0.10.0 commit b60de448f73185ed2c40b5c88b3032f44cd19036 Author: Žygimantas Medelis Date: Fri Sep 27 06:50:31 2019 +0300 release: setup pom to release to clojars commit 941af5c9645a63cfaef6db5c0edd7c1b6d08dcf8 Author: Žygimantas Medelis Date: Fri Sep 27 06:47:58 2019 +0300 [maven-release-plugin] prepare release openccg-0.10.0 commit e3614adb35e4f4be41ca4b3374598e4a01397def Author: Žygimantas Medelis Date: Fri Sep 27 06:47:38 2019 +0300 release: setup pom to release to clojars commit cd04e4fa89d07853c6853bd248a108d99d76f80f Author: Žygimantas Medelis Date: Fri Sep 27 06:40:53 2019 +0300 [maven-release-plugin] prepare release openccg-0.10.0 commit 873534a399b2ff604963ca2f6e7cf6ff442c3556 Author: Žygimantas Medelis Date: Fri Sep 27 06:40:38 2019 +0300 release: setup pom to release to clojars commit 399daec660715e4368014c399100f2c47de15e9d Author: Žygimantas Medelis Date: Fri Sep 27 06:39:44 2019 +0300 release: setup pom to release to clojars commit 8c7d7f06afa09e49ed626144e4acd92c615f2d7a Author: Žygimantas Medelis Date: Fri Sep 27 06:34:09 2019 +0300 [maven-release-plugin] prepare release openccg-0.10.0 commit b355967d36a47544b428a23ae9aa5cec3688dbb5 Author: Žygimantas Medelis Date: Fri Sep 27 06:33:51 2019 +0300 release: setup pom to release to clojars commit c220cd5fe5e2660beb60f005cf55effc099f44fb Author: Žygimantas Medelis Date: Fri Sep 27 06:32:38 2019 +0300 release: setup pom to release to clojars commit 1a107bd2bc2548b7b44d90ca9c9c13d0a3b23140 Author: Žygimantas Medelis Date: Fri Sep 27 06:31:59 2019 +0300 [maven-release-plugin] prepare release openccg-1.0.0 commit d7501d3d026cfa540cadd409cfde388bc81cf956 Author: Žygimantas Medelis Date: Fri Sep 27 06:31:42 2019 +0300 release: setup pom to release to clojars commit b53fd50b0eb3a432cbb297c753995a8d6408108d Author: Žygimantas Medelis Date: Fri Sep 27 06:31:13 2019 +0300 release: setup pom to release to clojars commit b088ed659a3c8d2b6e98dadd52211c75ea347a3b Author: Žygimantas Medelis Date: Fri Sep 27 06:27:14 2019 +0300 release: setup pom to release to clojars commit 66cace173cb6003333b41c127fed8161dde06a20 Author: Žygimantas Medelis Date: Thu Sep 26 17:58:19 2019 +0300 [maven-release-plugin] prepare release openccg-1.0.0 commit f730d15ce28f6478996ea4004bb37a338f90d9f8 Author: Žygimantas Medelis Date: Thu Sep 26 17:57:50 2019 +0300 release: setup pom to release to clojars commit d11451a2aad55c20851b98c12af6bbb6d784b61f Author: Žygimantas Medelis Date: Thu Sep 26 17:56:42 2019 +0300 release: setup pom to release to clojars commit 202a9295314cc569303e81d588a91306aa67fff9 Author: Žygimantas Medelis Date: Thu Sep 26 17:53:31 2019 +0300 [maven-release-plugin] prepare release openccg-1.0.0 commit ac3dce626fb870ec4edf63e84989764f48f0f28d Author: Žygimantas Medelis Date: Thu Sep 26 17:51:17 2019 +0300 release: setup pom to release to clojars commit f6097af0c8ea18fe374f65d102b414e37c4ae56f Author: Žygimantas Medelis Date: Thu Sep 26 17:40:04 2019 +0300 [maven-release-plugin] prepare release openccg-1.0.0 commit 16fad14117b9db8c5f882be281c966d3e5a6dad4 Author: Žygimantas Medelis Date: Thu Sep 26 17:39:35 2019 +0300 release: setup pom to release to clojars commit 22229c1442bdc2672efe63f2cd0731e199c23f1e Author: Žygimantas Medelis Date: Thu Sep 26 17:37:50 2019 +0300 [maven-release-plugin] prepare release ccg-1.0.0 commit 23f8c63674162ca5540cac6d6419cd89c06bbb6b Author: Žygimantas Medelis Date: Thu Sep 26 17:37:07 2019 +0300 [maven-release-plugin] prepare release ccg-1.0.0 commit 7ce824972ee491a6753d6ba9eab28e1afb76e7f2 Author: Žygimantas Medelis Date: Thu Sep 26 17:36:51 2019 +0300 release: setup pom to release to clojars commit 33a71af311e3e33a1774abcd7bda59c798d47f20 Author: Žygimantas Medelis Date: Thu Sep 26 17:25:29 2019 +0300 release: setup pom to release to clojars commit 64bbfeaa69f8da19c3735b12619f358ea73ee9e4 Author: Žygimantas Medelis Date: Thu Sep 26 17:16:03 2019 +0300 [maven-release-plugin] prepare release ccg-1.0.0 commit 743494fce8a32349c33ba0b2191b74870562c8f5 Author: Žygimantas Medelis Date: Thu Sep 26 17:14:46 2019 +0300 release: setup pom to release to clojars --- pom.xml | 84 +++++++++++++++++++++++++++++++++++++++++------------ src/pom.xml | 5 ++-- 2 files changed, 67 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index cf80c5a..41d00fa 100644 --- a/pom.xml +++ b/pom.xml @@ -1,19 +1,65 @@ - - - 4.0.0 - opennlp - ccg - 0.10.0 - pom - - - src/ - - - - 1.8 - 1.8 - - - + + + 4.0.0 + acceleratedtext + openccg + 0.10.3-SNAPSHOT + pom + + + src/ + + + + https://github.com/tokenmill/openccg.git + scm:git:https://github.com/tokenmill/openccg.git + scm:git:https://github.com/tokenmill/openccg.git + openccg-0.10.1 + + + + 1.8 + 1.8 + + + + src + + + src + + + classes + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + -Xdoclint:none + target.* + + + + + + + + + + clojars + https://repo.clojars.org/ + + + + + + clojars + https://repo.clojars.org + + + + diff --git a/src/pom.xml b/src/pom.xml index 4d905e4..29d5d4f 100644 --- a/src/pom.xml +++ b/src/pom.xml @@ -1,10 +1,9 @@ - + 4.0.0 opennlp openccg - 0.10.0 + 0.10.1-SNAPSHOT 1.8 From 2476a84cc22a1e764c548957dd2c9a0d13178981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDygimantas=20Medelis?= Date: Fri, 27 Sep 2019 09:02:02 +0300 Subject: [PATCH 23/28] deployment: add repository to modul --- pom.xml | 1 - src/pom.xml | 321 +++++++++++++++++++++++++++------------------------- 2 files changed, 168 insertions(+), 154 deletions(-) diff --git a/pom.xml b/pom.xml index 41d00fa..fee43df 100644 --- a/pom.xml +++ b/pom.xml @@ -47,7 +47,6 @@ - clojars diff --git a/src/pom.xml b/src/pom.xml index 29d5d4f..7a1259a 100644 --- a/src/pom.xml +++ b/src/pom.xml @@ -1,155 +1,170 @@ - 4.0.0 - opennlp - openccg - 0.10.1-SNAPSHOT - - - 1.8 - 1.8 - ${project.build.directory}/generated-sources - - - - - - jdom - jdom - 1.1 - - - - trove - trove - 1.0.2 - - - - org.apache.ant - ant - 1.9.0 - - - - net.sf.jgrapht - jgrapht - 0.8.3 - - - - net.sf.jopt-simple - jopt-simple - 3.1 - - - - junit - junit - 4.12 - - - - - jline - jline - 1.0 - - - - org.eclipse.birt.runtime.3_7_1 - org.apache.xml.serializer - 2.7.1 - - - - - - - openccg - . - - - maven-compiler-plugin - 3.7.0 - - - **/.backup.orig/** - srilmbridge/ - kenlm/ - - - - - org.codehaus.mojo - javacc-maven-plugin - 2.6 - - - jjt - generate-sources - - jjtree-javacc - - - ${basedir}/opennlp/ccgbank/parse/ - ${project.build.gen}/jjtree/ - - - - jj - generate-sources - - javacc - - - ${project.build.gen}/jjtree/opennlp/ccgbank/parse/ - ${project.build.gen}/jjtree/ - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - generate-sources - - add-source - - - - ${project.build.gen} - - - - - - - - - + 4.0.0 + opennlp + openccg + 0.10.1-SNAPSHOT + + + 1.8 + 1.8 + ${project.build.directory}/generated-sources + + + + + + jdom + jdom + 1.1 + + + + trove + trove + 1.0.2 + + + + org.apache.ant + ant + 1.9.0 + + + + net.sf.jgrapht + jgrapht + 0.8.3 + + + + net.sf.jopt-simple + jopt-simple + 3.1 + + + + junit + junit + 4.12 + + + + + jline + jline + 1.0 + + + + org.eclipse.birt.runtime.3_7_1 + org.apache.xml.serializer + 2.7.1 + + + + + + + openccg + . + + + maven-compiler-plugin + 3.7.0 + + + **/.backup.orig/** + srilmbridge/ + kenlm/ + + + + + org.codehaus.mojo + javacc-maven-plugin + 2.6 + + + jjt + generate-sources + + jjtree-javacc + + + ${basedir}/opennlp/ccgbank/parse/ + ${project.build.gen}/jjtree/ + + + + jj + generate-sources + + javacc + + + ${project.build.gen}/jjtree/opennlp/ccgbank/parse/ + ${project.build.gen}/jjtree/ + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + generate-sources + + add-source + + + + ${project.build.gen} + + + + + + + + + + + + + clojars + https://repo.clojars.org/ + + + + + + clojars + https://repo.clojars.org + + + From 2b33648122b0a79fe7a26cd9f452f1db47658f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDygimantas=20Medelis?= Date: Fri, 27 Sep 2019 09:07:14 +0300 Subject: [PATCH 24/28] deployment: add repository to modul --- src/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pom.xml b/src/pom.xml index 7a1259a..8d254f8 100644 --- a/src/pom.xml +++ b/src/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - opennlp + accelertedtext openccg - 0.10.1-SNAPSHOT + 0.10.3-SNAPSHOT 1.8 From 7a64b6c022d750bbe3866b013003b4853fa3ec79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDygimantas=20Medelis?= Date: Fri, 27 Sep 2019 09:12:34 +0300 Subject: [PATCH 25/28] fix: project name: --- src/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pom.xml b/src/pom.xml index 8d254f8..a6977b6 100644 --- a/src/pom.xml +++ b/src/pom.xml @@ -1,7 +1,7 @@ 4.0.0 - accelertedtext + acceleratedtext openccg 0.10.3-SNAPSHOT From e4f950b4f91345fb7983d9d4c59e7312286ca808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDygimantas=20Medelis?= Date: Fri, 27 Sep 2019 09:13:39 +0300 Subject: [PATCH 26/28] chore: bump versions --- pom.xml | 2 +- src/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index fee43df..6872aa5 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 acceleratedtext openccg - 0.10.3-SNAPSHOT + 0.10.4-SNAPSHOT pom diff --git a/src/pom.xml b/src/pom.xml index a6977b6..70996b3 100644 --- a/src/pom.xml +++ b/src/pom.xml @@ -3,7 +3,7 @@ 4.0.0 acceleratedtext openccg - 0.10.3-SNAPSHOT + 0.10.4-SNAPSHOT 1.8 From cd392904ebf3a40112014eea89ce32d6a51eee3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDygimantas=20Medelis?= Date: Fri, 27 Sep 2019 09:14:57 +0300 Subject: [PATCH 27/28] chore: bump versions --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6872aa5..e06330a 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 acceleratedtext - openccg + openccg-parent 0.10.4-SNAPSHOT pom From 9f889d15f89febcd2223238bb2f606558f4ecd30 Mon Sep 17 00:00:00 2001 From: Zygimantas Medelis Date: Fri, 27 Sep 2019 09:59:59 +0300 Subject: [PATCH 28/28] chore: drop snapshot --- pom.xml | 2 +- src/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e06330a..a16ab31 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 acceleratedtext openccg-parent - 0.10.4-SNAPSHOT + 0.10.4 pom diff --git a/src/pom.xml b/src/pom.xml index 70996b3..7dcb087 100644 --- a/src/pom.xml +++ b/src/pom.xml @@ -3,7 +3,7 @@ 4.0.0 acceleratedtext openccg - 0.10.4-SNAPSHOT + 0.10.4 1.8