diff options
Diffstat (limited to 'Algorithms/Part-II/1-WordNet/WordNet.java')
-rw-r--r-- | Algorithms/Part-II/1-WordNet/WordNet.java | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/Algorithms/Part-II/1-WordNet/WordNet.java b/Algorithms/Part-II/1-WordNet/WordNet.java new file mode 100644 index 0000000..830ccdf --- /dev/null +++ b/Algorithms/Part-II/1-WordNet/WordNet.java @@ -0,0 +1,58 @@ +/* vim: set expandtab tabstop=4 shiftwidth=4 : */ + +public class WordNet +{ + // data type space linear in the input size + + // constructor takes the name of the two input files + public WordNet(String synsets, String hypernyms) + { + // time linearithmic in the input size + + // throw a java.lang.IllegalArgumentException + // if the input does not correspond to a rooted DAG + } + + // the set of nouns (no duplicates), returned as an Iterable + public Iterable<String> nouns() + { + return null; + } + + // is the word a WordNet noun? + public boolean isNoun(String word) + { + // run in time logarithmic in the number of nouns + + return false; + } + + // distance between nounA and nounB (defined below) + public int distance(String nounA, String nounB) + { + // run in time linear in the size of the WordNet digraph + + // throw java.lang.IllegalArgumentException + // unless both of the noun arguments are WordNet nouns + + return 0; + } + + // a synset that is the common ancestor of nounA and nounB + // in a shortest ancestral path + public String sap(String nounA, String nounB) + { + // run in time linear in the size of the WordNet digraph + + // throw java.lang.IllegalArgumentException + // unless both of the noun arguments are WordNet nouns + + return ""; + } + + // for unit testing of this class + public static void main(String[] args) + { + } +} + |