public final class RamTrie
extends java.lang.Object
History:
Constructor and Description |
---|
RamTrie(boolean isInflection,
int minTermLength,
java.lang.String dir,
int minTrieStemLength)
Create an object of LVG trie, using a flag to indicate
using inflection or derivation trie.
|
Modifier and Type | Method and Description |
---|---|
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<CatInfl> |
GetCatInflsByRules(java.lang.String term,
long inCat,
long inInfl)
Get all possible categories and inflections for a term from trie rules.
|
java.util.Vector<RuleResult> |
GetDerivationsByRules(java.lang.String term,
long inCat,
long inInfl,
boolean showAll)
Get derivation for a specific term from LVG trie rules.
|
java.util.Vector<RuleResult> |
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
|
TrieTree |
GetTrie()
Get the object of trie tree.
|
java.util.Vector<RuleResult> |
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)
This is the executable program for using LVG rule trie through RAM.
|
void |
PrintResults(java.util.Vector<RuleResult> resultList)
Print out a collection of trie ruleresult.
|
void |
SetMinTermLength(int minTermLength)
Set the minimum term length
|
public RamTrie(boolean isInflection, int minTermLength, java.lang.String dir, int minTrieStemLength)
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 LVGminTrieStemLength
- min. legal stem length in triepublic java.util.Vector<RuleResult> 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 inflectionspublic java.util.Vector<CatInfl> GetCatInflsByRules(java.lang.String term, long inCat, long inInfl)
term
- the term to be found all possible categories and inflectionsinCat
- input categoriesinInfl
- input inflectionspublic java.util.Vector<RuleResult> 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<RuleResult> 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<RuleResult> resultList)
resultList
- A vector of ruleResult to be print out.public TrieTree GetTrie()
public int GetMatchedNodeNum()
public void SetMinTermLength(int minTermLength)
minTermLength
- minimum term length used in Morpologypublic static void main(java.lang.String[] args)
args
- arguments