Sub-Term APIs: Find Sub-Terms Design
I. Introduction
This section describes the sub-term related methods used to find:
II. Algorithm
III. Java Classes & Method
public static Vector FindSubtermStrs(String inTerm, Corpus corpus)
public static Vector FindSubterms(String inTerm, Corpus corpus)
public static Vector FindAllPrefixSubterms(String inTerm, Corpus corpus)
public static String FindLongestPrefixSubterm(String inTerm, Corpus corpus)
IV. Examples
word | synonym |
---|---|
dog | canine |
cat | feline |
canine | K9 |
K9 | bull dog |
Dog and cat | pets |
puppy and kitty | pets |
Terms |
---|
dog |
canine |
cat |
feline |
k9 |
bull dog |
dog and cat |
pets |
puppy and kitty |
i | curTerm | branchMatches | matchTerms |
---|---|---|---|
0 | who let dog and cat out | ||
1 | let dog and cat out | ||
2 | dog and cat out |
|
|
3 | and cat out |
| |
4 | cat out |
|
|
5 | out |
|
return matched terms | start index | end indexes: