|
Lvg Java 2006p Version |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.nih.nlm.nls.lvg.Trie.PersistentTrie
public final class PersistentTrie
This class provides API for using LVG persistent trie rules. As a matter of fact, this class is the highest level of API for the LVG persistent trie package and is the only class that is used by LVG flow components.
History:
| Field Summary | |
|---|---|
static long |
LEGAL_BASE
|
static long |
LEGAL_CATEGORY
a number get by using bit-or for legal categories: adj, adv, noun, verb |
static long |
LEGAL_INFLECTION
a number get by using bit-or for legal inflections: base - singular - plural - positive - comparative - superlative - infinitive - pres - past - presPart - pastPart |
| Constructor Summary | |
|---|---|
PersistentTrie(boolean isInflection,
int minTermLength,
java.lang.String dir)
Create an object of LVG persistent trie, using a flag to indicate using inflection or derivation trie. |
|
PersistentTrie(java.io.RandomAccessFile trieRaf,
java.io.RandomAccessFile ruleRaf,
java.io.RandomAccessFile exceptionRaf,
int minTermLength,
boolean isInflection)
Create an object of LVG persistent trie, using random acccess files of trie, rule, and exception. |
|
| Method Summary | |
|---|---|
(package private) static java.util.Vector |
AddRusultsToInflectList(java.util.Vector oldList,
java.util.Vector newList)
|
void |
Close()
Close all random access files of Lvg persistent trie, rules, exceptions. |
CatInfl |
GetCatInflByRules(java.lang.String term,
long inCat,
long inInfl)
Get all possible categories and inflections for a term from trie rules. |
java.util.Vector |
GetCatInflsByRules(java.lang.String term,
long inCat,
long inInfl)
Get all possible categories and inflections for a term from trie rules. |
java.util.Vector |
GetDerivationsByRules(java.lang.String term,
long inCat,
long inInfl,
boolean showAll)
Get derivation for a specific term from LVG trie rules. |
java.util.Vector |
GetInflectedTermsByRules(java.lang.String term,
long inCat,
long inInfl,
boolean showAll)
Get inflected terms for a specific term from LVG trie rules. |
int |
GetMatchedNodeNum()
Get the total number of nodes which match suffix |
java.util.Vector |
GetUninflectedTermsByRules(java.lang.String term,
long inCat,
long inInfl,
boolean showAll)
Get uninflected terms for a specific inflected term from LVG trie rules. |
static void |
main(java.lang.String[] args)
A test driver for this class. |
void |
PrintResults(java.util.Vector resultList)
Print out a collection of trie ruleresult. |
void |
SetMinTermLength(int minTermLength)
Set the minimum term length |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long LEGAL_CATEGORY
public static final long LEGAL_INFLECTION
public static final long LEGAL_BASE
| Constructor Detail |
|---|
public PersistentTrie(boolean isInflection,
int minTermLength,
java.lang.String dir)
isInflection - true or false to indicate the persistent trie
type as inflections or derivations.minTermLength - minimum length of rule generated out termdir - the top directory of LVG
public PersistentTrie(java.io.RandomAccessFile trieRaf,
java.io.RandomAccessFile ruleRaf,
java.io.RandomAccessFile exceptionRaf,
int minTermLength,
boolean isInflection)
trieRaf - random access file of Lvg persistent trieruleRaf - random access file of Lvg persistent ruleexceptionRaf - random access file of Lvg persistent exceptionminTermLength - minimum length of rule generated out termisInflection - true or false to indicate the persistent trie
type as inflections or derivations.| Method Detail |
|---|
public void Close()
public java.util.Vector GetUninflectedTermsByRules(java.lang.String term,
long inCat,
long inInfl,
boolean showAll)
term - the term to be found for uninflectionsinCat - the input categoryinInfl - the input inflectionshowAll - set false to get uninflected terms from a node that has
matching suffix and ignore all other matching nodes above it in the
same tree branch.
public CatInfl GetCatInflByRules(java.lang.String term,
long inCat,
long inInfl)
term - the term to be found all possible categories and inflectionsinCat - input categoriesinInfl - input inflections
public java.util.Vector GetCatInflsByRules(java.lang.String term,
long inCat,
long inInfl)
term - the term to be found all possible categories and inflectionsinCat - input categoriesinInfl - input inflections
public java.util.Vector GetInflectedTermsByRules(java.lang.String term,
long inCat,
long inInfl,
boolean showAll)
term - the term to be found for inflectionsinCat - the input categoryinInfl - the input inflectionshowAll - set false to get inflected terms from a node that has
matching suffix and ignore all other matching nodes above it in the
same tree branch.
public java.util.Vector GetDerivationsByRules(java.lang.String term,
long inCat,
long inInfl,
boolean showAll)
term - the term to be found for derivationsinCat - the input categoryinInfl - the input inflectionshowAll - set false to get derivation from a node that has
matching suffix and ignore all other matching nodes above it in the
same tree branch.
public void PrintResults(java.util.Vector resultList)
resultList - A vector of ruleResult to be print out.public int GetMatchedNodeNum()
public void SetMinTermLength(int minTermLength)
minTermLength - minimum term length used in Morpologypublic static void main(java.lang.String[] args)
static java.util.Vector AddRusultsToInflectList(java.util.Vector oldList,
java.util.Vector newList)
|
Lvg Java 2006p Version |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||