diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-11-21 18:18:06 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2013-11-21 18:18:06 +0100 |
commit | 4020858e2a7ca3557d6ddfa40ceec0a191ef2605 (patch) | |
tree | 7aa6747d6470b24ac384987610f8416a212e1b50 /Algorithms/Part-II/1-WordNet/WordNet.java | |
parent | b748bc695362b353af08a9d9019876761500012f (diff) | |
download | coursera-4020858e2a7ca3557d6ddfa40ceec0a191ef2605.zip coursera-4020858e2a7ca3557d6ddfa40ceec0a191ef2605.tar.gz |
Algorithms-II : 1-WordNet: add prototypes and data
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) + { + } +} + |