Lexical Tools

Remove Genitive

  • Short Description: Remove possessives

  • Full Description:

    This is useful when trying to normalize terms such as Down's Syndrome and Down Syndrome to one form.

    No effect on the -m option. "none" is added at the end of the output.

  • Difference:
    1. New version trims output terms (remove spaces at the beginning and ending of the term).


  • Features:
    1. Recursively remove " 's " and " 'S " at the end of any words in the input term (AAA's -> AAA).
    2. Remove apostrophe if " s' " and " S' " at the end of any words in the input term (AAAs' -> AAAs).
    3. Remove apostrophe if " x' " and " X' " at the end of any words in the input term (AAAx' -> AAAx).
    4. Remove apostrophe if " z' " and " Z' " at the end of any words in the input term (AAAz' -> AAAz).


  • Symbol: g

  • Examples:
    
    shell> lvg -f:g
    Down Syndrome
    Down Syndrome|Down Syndrome|2047|16777215|g|1|
    
    Downs' Syndrome
    Downs' Syndrome|Downs Syndrome|2047|16777215|g|1|
    
    Downx' Syndrome
    Downx' Syndrome|Downx Syndrome|2047|16777215|g|1|
    
    Downz' Syndrome
    Downz' Syndrome|Downz Syndrome|2047|16777215|g|1|
    
    Down's Syndrome
    Down's Syndrome|Down Syndrome|2047|16777215|g|1|
    
    Down's's Syndrome
    Down's's Syndrome|Down Syndrome|2047|16777215|g|1|
    
    More examples

  • Implementation Logic:
    1. Tokenize each word from the input term by using StringTokenizer.
    2. Ignore cases
    3. For each word, recursively remove " 's " at the end of the word.
    4. For each word, remove apostrophe if " s' " at the end of the word.
    5. For each word, remove apostrophe if " x' " at the end of the word.
    6. For each word, remove apostrophe if " z' " at the end of the word.
    7. Trim each word.

  • Source Code: ToRemoveGenitive.java

  • Hierarchy: Object -> Transformation -> ToRemoveGenitive