![JAR search and dependency download from the Maven repository](/logo.png)
gov.nih.nlm.nls.lvg.Trie.package.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lvg2010dist Show documentation
Show all versions of lvg2010dist Show documentation
LVG tools is used by Apache cTAKES.
The newest version!
Provides the classes necessary to generate inflections, uninflections, and
derivations using LVG rules tries. This package provides a persistent data storing and retrieving mechanism for the application of LVG rules. The original design concept is from previous version of LVG.
Features
Features of this package are described as follows:
- Stores Lvg rule information in files instead of RAM.
- Provides random access ability for quick retrieval.
Usage
- Inflection & Uninflection:
- Initiate a persistent trie object
PersistentTrie trie = new PersistentTrie(true);
- Retrieve inflections for a String str
Vector inflections = trie.GetInflectedTermsByRules(inStr, true);
- Retrieve uninflections for a String str
Vector uninflections = trie.GetUninflectedTermsByRules(inStr, true);
- Close the trie
trie.Close();
- Derivation:
- Initiate a persistent trie object
PersistentTrie trie = new PersistentTrie(false);
- Retrieve derivations for a String str
Vector derivations = trie.GetDerivationsByRules(inStr, true);
- Close the trie
trie.Close();
Files
The flat file for these LVG rules are under $LVG_DIR/data/rules/. They are:
- im.rul: rules of inflections and uninflections
- plural.rul: rules of plural, used by im.rul
- verbinfl.rul: rules of verb inflections, used by im.rul
- dm.rul: rules of derivations
The above files are read in by LVG trie pre-process programs and then stored as binary files for LVG trie system to retrieve later. These binary files are
generated before LVG is distributed and are listed as follows:
- trieI.data: data for trie tree of inflection
- ruleI.data: data of inflection rules
- exceptionI.data: data of exceptions on inflection rules
- trieD.data: data for trie tree of derivation rules
- ruleD.data: data of derivation rules
- exceptionD.data: data of exceptions on derivation rules
Related Documents
@since 2002
© 2015 - 2025 Weber Informatics LLC | Privacy Policy