Package games.stendhal.common.grammar
Class PrefixExtractor
java.lang.Object
games.stendhal.common.grammar.PrefixExtractor
PrefixProcessor is used to process prefix texts in a text string.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Extracts noun from a string, that may be prefixed with a plural expression like "piece of", ...boolean
Extracts noun from a string, that may be prefixed with a singular expression like "piece of", ...boolean
removePrefix(String prefix)
Removes a prefix, if present.toString()
-
Constructor Details
-
PrefixExtractor
-
-
Method Details
-
removePrefix
Removes a prefix, if present. If the prefix was found at the beginning of the object name, it is removed. Otherwise txt remains unchanged.- Parameters:
prefix
-- Returns:
- true if a prefix was removed
-
extractNounSingular
public boolean extractNounSingular()Extracts noun from a string, that may be prefixed with a singular expression like "piece of", ... The result is stored in txt.- Returns:
- true on any change of txt
-
extractNounPlural
public boolean extractNounPlural()Extracts noun from a string, that may be prefixed with a plural expression like "piece of", ... The result is stored in txt.- Returns:
- true on any change of txt
-
toString
-