All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.nih.nlm.nls.lvg.Trie.package.html Maven / Gradle / Ivy

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:
    1. Initiate a persistent trie object
      PersistentTrie trie = new PersistentTrie(true);
    2. Retrieve inflections for a String str
      Vector inflections = trie.GetInflectedTermsByRules(inStr, true);
    3. Retrieve uninflections for a String str
      Vector uninflections = trie.GetUninflectedTermsByRules(inStr, true);
    4. Close the trie
      trie.Close();
  • Derivation:
    1. Initiate a persistent trie object
      PersistentTrie trie = new PersistentTrie(false);
    2. Retrieve derivations for a String str
      Vector derivations = trie.GetDerivationsByRules(inStr, true);
    3. 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