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:
- New version trims output terms (remove spaces at the beginning and ending of the term).
- Features:
- Recursively remove " 's " and " 'S " at the end of any words in the input term (AAA's -> AAA).
- Remove apostrophe if " s' " and " S' " at the end of any words in the input term (AAAs' -> AAAs).
- Remove apostrophe if " x' " and " X' " at the end of any words in the input term (AAAx' -> AAAx).
- 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:
- Tokenize each word from the input term by using StringTokenizer.
- Ignore cases
- For each word, recursively remove " 's " at the end of the word.
- For each word, remove apostrophe if " s' " at the end of the word.
- For each word, remove apostrophe if " x' " at the end of the word.
- For each word, remove apostrophe if " z' " at the end of the word.
- Trim each word.
Source Code: ToRemoveGenitive.java
Hierarchy: Object -> Transformation -> ToRemoveGenitive