Lvg Java
2006p Version

gov.nih.nlm.nls.lvg.Trie
Class WildCard

java.lang.Object
  extended by gov.nih.nlm.nls.lvg.Trie.WildCard

public final class WildCard
extends java.lang.Object

This class creates an object of wild cards for trie.

History:

Version:
V-2006p
Author:
NLM NLS Development Team
See Also:
Design Document

Field Summary
static char BEGIN
          a character symbol for represetning the beginning of a string
static char CONSONANT
          a character symbol for representing a consonant
static char DIGIT
          a character symbol for representing a digit [0-9]
static char END
          a character symbol for represetning the end of a string
static char FS
          a character symbol for representing a field separator
static char LETTER
          a character symbol for representing a letter [a-z]
static char SAME_AS_PREV
          a character symbol for representing a same character as the following character in the string
static char VOWEL
          a character symbol for representing a vowel: [a,e,i,o,u]
 
Method Summary
static java.lang.String GetSuffix(java.lang.String inSuffix, java.lang.String outSuffix, java.lang.String inStr)
          Get a string with modified suffix from a specified string by giving the in suffix and out suffix of a rule to be applied.
static boolean IsMatchKey(char key, int index, char[] inCharArray)
          Check if a specific key matches a character of a suffix.
static boolean IsWildCard(char inChar)
          Check if a specific character belong ot a pre-defined wild card.
static void main(java.lang.String[] args)
          test driver for this class.
static char WildCardTransform(char inChar)
          Transform a specific character to a wildCard
static java.lang.String WildCardTransform(java.lang.String inStr)
          Transform a specific string to a string consist of wildcard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VOWEL

public static final char VOWEL
a character symbol for representing a vowel: [a,e,i,o,u]

See Also:
Constant Field Values

CONSONANT

public static final char CONSONANT
a character symbol for representing a consonant

See Also:
Constant Field Values

SAME_AS_PREV

public static final char SAME_AS_PREV
a character symbol for representing a same character as the following character in the string

See Also:
Constant Field Values

DIGIT

public static final char DIGIT
a character symbol for representing a digit [0-9]

See Also:
Constant Field Values

LETTER

public static final char LETTER
a character symbol for representing a letter [a-z]

See Also:
Constant Field Values

BEGIN

public static final char BEGIN
a character symbol for represetning the beginning of a string

See Also:
Constant Field Values

END

public static final char END
a character symbol for represetning the end of a string

See Also:
Constant Field Values

FS

public static final char FS
a character symbol for representing a field separator

See Also:
Constant Field Values
Method Detail

GetSuffix

public static java.lang.String GetSuffix(java.lang.String inSuffix,
                                         java.lang.String outSuffix,
                                         java.lang.String inStr)
Get a string with modified suffix from a specified string by giving the in suffix and out suffix of a rule to be applied.

Parameters:
inSuffix - the matching suffix of input term
outSuffix - the generated output suffix
inStr - the string will be modified it's suffix
Returns:
a string with modified suffix

IsMatchKey

public static boolean IsMatchKey(char key,
                                 int index,
                                 char[] inCharArray)
Check if a specific key matches a character of a suffix. The suffix is represented as an array of character and is specified by index.

Parameters:
key - the key character to be checked for matching
index - the index of character in the input array for matching
inCharArray - a character array to represent a suffix
Returns:
true or false to represent the specified key does or does not match a specified character in the specified suffix

WildCardTransform

public static char WildCardTransform(char inChar)
Transform a specific character to a wildCard

Parameters:
inChar - the character to be transform to a wild card
Returns:
a wild card, which is transformed from the specific character

WildCardTransform

public static java.lang.String WildCardTransform(java.lang.String inStr)
Transform a specific string to a string consist of wildcard. This function does not need to be used in LVG trie rule operations since all rules are transformed into wildcard in the input file.

Parameters:
inStr - the string to be transformed to wild cards
Returns:
a string consist of wild cards, transformed from the specific string

IsWildCard

public static boolean IsWildCard(char inChar)
Check if a specific character belong ot a pre-defined wild card.

Parameters:
inChar - the character to be test for a wild card
Returns:
true or false to represent the specified character is or is not a wild card

main

public static void main(java.lang.String[] args)
test driver for this class.


Lvg Java
2006p Version

Submit a bug or feature

Copyright © 2006p National Library of Medicine