CMObject
, Tickable
, CMLibrary
, EnglishParsing
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class EnglishParser extends StdLibrary implements EnglishParsing
Modifier and Type | Class | Description |
---|---|---|
protected static class |
EnglishParser.FetchFlags |
Modifier and Type | Field | Description |
---|---|---|
static char[] |
ALL_CHRS |
|
static java.lang.String[] |
ARTICLES |
|
static java.util.List<Environmental> |
empty |
|
static java.lang.String[] |
feewords1 |
|
static java.lang.String[] |
feewords2 |
|
static java.lang.String[] |
fnouns |
|
static java.lang.String[] |
frwords |
|
static java.lang.String[] |
fwords |
|
static java.lang.String[] |
INDARTICLES |
|
static boolean[] |
NARROW_PUNCTUATION_TABLE |
|
static java.lang.String[] |
num_words |
|
static java.lang.String[] |
num_words_10 |
|
static java.lang.String[] |
num_words_x |
|
static java.lang.String[] |
numth_words |
|
static boolean[] |
PUNCTUATION_TABLE |
idConverter
isDebugging, name, serviceClient, tickStatus
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
EnglishParser() |
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
bumpDotContextNumber(java.lang.String srchStr,
int thisMuch) |
Given a context-specific name, this method returns the
name with the number adjusted according to the given amount.
|
protected java.lang.String |
cleanExtraneousDollarMarkers(java.lang.String srchStr) |
|
java.lang.String |
cleanPrepositions(java.lang.String s) |
If the given phrase begins with a preposition word
such as to, over, beside, than, since, it will strip
the word off and return the rest of the string.
|
protected java.lang.String |
collapsedName(Ability thisAbility) |
|
boolean |
containsOneOfString(java.lang.String toSrchStr,
java.util.List<java.lang.String> srchForStrs) |
Returns whether the given string contains any of the srchForStr substrings.
|
boolean |
containsString(java.lang.String toSrchStr,
java.lang.String srchForStr) |
Returns whether the first string contains the second, case insensitive, and color
insensitive.
|
java.lang.String |
coordDescShort(long[] coords) |
Returns [best distance],[best distance],[best distance]
A [best distance] picks the best of dm, km, etc..
|
java.lang.String |
directionDescShort(double[] dir) |
Returns direction in [degrees.YY] mark [degrees.YY]
|
java.lang.String |
directionDescShortest(double[] dir) |
Returns direction in [degrees.Y] [space] [degrees.Y]
|
java.lang.String |
distanceDescShort(long distance) |
Returns [best distance] for the given number.
|
boolean |
equalsPunctuationless(char[] strC,
char[] str2C) |
|
protected boolean |
evokedBy(Ability thisAbility,
java.lang.String thisWord) |
|
protected boolean |
evokedBy(Ability thisAbility,
java.lang.String thisWord,
java.lang.String secondWord) |
|
Environmental |
fetchAvailable(java.util.Collection<? extends Environmental> list,
java.lang.String srchStr,
Item goodLocation,
Filterer<Environmental> filter,
boolean exactOnly) |
Returns a matching environmental object from a collection of them
by using a search string to matching, a required filter, and for items,
a container which may be null.
|
Environmental |
fetchAvailable(java.util.Collection<? extends Environmental> list,
java.lang.String srchStr,
Item goodLocation,
Filterer<Environmental> filter,
boolean exactOnly,
int[] counterSlap) |
Returns a matching environmental object from a collection of them
by using a search string to matching, a required filter, and for items,
a container which may be null.
|
Item |
fetchAvailableItem(java.util.List<Item> list,
java.lang.String srchStr,
Item goodLocation,
Filterer<Environmental> filter,
boolean exactOnly) |
Returns a matching item from a collection of them
by using a search string to matching, a required filter, and
a container which may be null.
|
java.util.List<Item> |
fetchAvailableItems(java.util.List<Item> list,
java.lang.String srchStr,
Item goodLocation,
Filterer<Environmental> filter,
boolean exactOnly) |
Returns a set of matching items from a collection of them
by using a search string to matching, a required filter, and
a container which may be null.
|
Environmental |
fetchEnvironmental(java.lang.Iterable<? extends Environmental> list,
java.lang.String srchStr,
boolean exactOnly) |
Returns a matching environmental object from an iterable collection of them
by using a search string to matching.
|
Environmental |
fetchEnvironmental(java.util.Enumeration<? extends Environmental> iter,
java.lang.String srchStr,
boolean exactOnly) |
Returns a matching environmental object from an enumeration of them
by using a search string to matching.
|
Environmental |
fetchEnvironmental(java.util.Iterator<? extends Environmental> iter,
java.lang.String srchStr,
boolean exactOnly) |
Returns a matching environmental object from an iterator of them
by using a search string to matching.
|
Environmental |
fetchEnvironmental(java.util.Map<java.lang.String,? extends Environmental> list,
java.lang.String srchStr,
boolean exactOnly) |
Returns a matching environmental object from map of them
by using a search string to matching.
|
java.util.List<Environmental> |
fetchEnvironmentals(java.util.List<? extends Environmental> list,
java.lang.String srchStr,
boolean exactOnly) |
Returns a set of matching environmental objects from a collection of them
by using a search string to matching.
|
Exit |
fetchExit(java.lang.Iterable<? extends Environmental> list,
java.lang.String srchStr,
boolean exactOnly) |
Returns a matching exit object from an iterable collection of them
by using a search string to matching.
|
EnglishParser.FetchFlags |
fetchFlags(java.lang.String srchStr) |
|
java.util.List<Item> |
fetchItemList(ItemPossessor from,
MOB mob,
Item container,
java.util.List<java.lang.String> matchWords,
Filterer<Environmental> filter,
boolean visionMatters) |
Returns a set of matching items from a given item possessor.
|
<T> T |
fetchReflective(java.lang.Iterable<T> list,
java.lang.String srchStr,
java.lang.String methodName,
boolean exactOnly) |
Returns a matching T object from an iterable collection of them
by using a search string to matching.
|
CMObject |
findCommand(MOB mob,
java.util.List<java.lang.String> commands) |
Given a user input array, this method will find the skill, command, social,
channel, or journal that is trying to be invoked by the user input and,
if found, return it.
|
Social |
findSocial(MOB mob,
java.util.List<java.lang.String> commands,
boolean exactOnly) |
|
java.util.List<java.lang.String> |
getAllContextNames(java.util.Collection<? extends Environmental> list,
Filterer<Environmental> filter) |
Given a list of objects and an optional filter, this method returns
a list of identical size and order, with the context-specific names
instead of the objects.
|
protected java.lang.String |
getBestDistance(long d) |
|
int |
getContextDotNumber(java.lang.String srchStr) |
Returns the context number of the given context-specific name.
|
java.lang.String |
getContextName(Environmental[] list,
Environmental E) |
Returns the context-qualified name of the item in the given
list is exactly the given environmental.
|
java.lang.String |
getContextName(ItemCollection cont,
Environmental E) |
Returns the context-qualified name of the item in the given
collection is exactly the given environmental.
|
java.lang.String |
getContextName(java.util.Collection<? extends Environmental> list,
Environmental E) |
Returns the context-qualified name of the item in the given
collection is exactly the given environmental.
|
int |
getContextNumber(Environmental[] list,
Environmental E) |
Returns the context number of the item in the given
list is exactly the given environmental.
|
int |
getContextNumber(ItemCollection cont,
Environmental E) |
Returns the context number of the item in the given
collection is exactly the given environmental.
|
int |
getContextNumber(java.util.Collection<? extends Environmental> list,
Environmental E) |
Returns the context number of the item in the given
collection is exactly the given environmental.
|
java.lang.String |
getContextSameName(Environmental[] list,
Environmental E) |
Returns the context-specific full name of the object in the
given list that is otherwise identical to the given
environmental.
|
java.lang.String |
getContextSameName(ItemCollection cont,
Environmental E) |
Returns the context-specific full name of the object in the
given collection that is otherwise identical to the given
environmental.
|
java.lang.String |
getContextSameName(java.util.Collection<? extends Environmental> list,
Environmental E) |
Returns the context-specific full name of the object in the
given collection that is otherwise identical to the given
environmental.
|
int |
getContextSameNumber(Environmental[] list,
Environmental E) |
Returns the context number of the object in the
given collection that is otherwise identical to the given
environmental.
|
int |
getContextSameNumber(ItemCollection cont,
Environmental E) |
Returns the context number of the object in the
given collection that is otherwise identical to the given
environmental.
|
int |
getContextSameNumber(java.util.Collection<? extends Environmental> list,
Environmental E) |
Returns the context number of the object in the
given list that is otherwise identical to the given
environmental.
|
java.lang.String |
getFirstWord(java.lang.String str) |
Returns the first word in the given phrase, ignoring color.
|
long |
getMillisMultiplierByName(java.lang.String timeName) |
Converts the given time specifier, or something that might
be a time specifier, into the appropriate number of milliseconds.
|
java.lang.String |
getSkillInvokeWord(MOB mob,
java.lang.String word) |
Given a user input array, this method will find the skill that is trying to be
invoked by the MAIN invocation word and, if found, return that word.
|
Ability |
getSkillToInvoke(MOB mob,
java.util.List<java.lang.String> commands) |
Given a user input array, this method will find the skill that is trying to be
invoked by the commands and return it.
|
boolean |
hasEnglishPunctuation(java.lang.String str) |
Returns true if the given string contains
any normal punctuation characters.
|
boolean |
hasPunctuation(java.lang.String str) |
Returns true if the given string contains
any extended punctuation characters.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
java.lang.String |
insertAdjectives(java.lang.String paragraph,
java.lang.String[] adjsToChoose,
int pctChance) |
Inserts one of the given adjectives after an article word found in the
given paragraph, a given percentage chance of the time.
|
java.lang.String |
insertUnColoredAdjective(java.lang.String str,
java.lang.String adjective) |
Inserts the given adjective before a given word or noun phrase, replacing any
indefinite articles with the new correct one, and removing any "color"
characters from the final phrase.
|
void |
invokeSkill(MOB mob,
java.util.List<java.lang.String> commands) |
Given a user input array, this method will find the skill that is trying to be
invoked by the commands and invoke it.
|
boolean |
isAnArticle(java.lang.String s) |
Returns whether the given string is an
article, such as a, an, the, some, etc..
|
boolean |
isAnIndefiniteArticle(java.lang.String s) |
Returns whether the given string is an
indefinite article, such as a, an, some, etc..
|
boolean |
isEnglishPunctuation(byte b) |
Returns true if the given byte is
any normal punctuation character.
|
boolean |
isPunctuation(byte b) |
Returns true if the given byte is
any extended punctuation character.
|
protected java.lang.String |
makeLowNumberWords(short num,
boolean and) |
|
java.lang.String |
makeNumberthWords(int num) |
Returns the english representation of the given numberst,
numberth, number-numberth, etc.
|
java.lang.String |
makeNumberWords(double num,
int precision) |
Returns the english representation of the given number
|
java.lang.String |
makePastTense(java.lang.String word,
java.lang.String defaultWord) |
Returns a best guess on the past-tense form
of the given word.
|
java.lang.String |
makePlural(java.lang.String str) |
Attempts to pluralize a given word.
|
java.lang.String |
makeSingular(java.lang.String str) |
Attempts to de-pluralize a given word.
|
java.lang.String |
matchAnyCurrencySet(java.lang.String moneyStr) |
For cases when a string input must contain an amount of money,
this method is used to determine the currency id reflect by
the whole denomination specified by the given user input.
|
double |
matchAnyDenomination(java.lang.String currency,
java.lang.String moneyStr) |
For cases when a string input must contain an amount of money,
this method is used to determine the Whole Denomination multiplier
specified by the given user input, and optionally, from the given
currency.
|
Item |
parseBestPossibleGold(MOB mob,
Container container,
java.lang.String itemID) |
Attempts to determine if the given user input specifies an amount
of currency owned by the given player, and if so, returns that precise
amount parsed from the players existing currency.
|
int |
parseMaxToGive(MOB mob,
java.util.List<java.lang.String> commands,
boolean breakPackages,
Environmental checkWhat,
boolean getOnly) |
Parses user input to determine if the user, who is
specifying an item of some sort, is intending to
specify multiples of those items by using a number
in front of their input.
|
Triad<java.lang.String,java.lang.Double,java.lang.Long> |
parseMoneyStringSDL(MOB mob,
java.lang.String moneyStr,
java.lang.String correctCurrency) |
For cases when a string input probably contains an amount of money,
this method is used to determine the currency, denomination, and
number of units of that currency.
|
long |
parseNumPossibleGold(Environmental mine,
java.lang.String moneyStr) |
For cases when a string input probably contains an amount of money,
this method is used to determine the amount (not value).
|
java.lang.String |
parseNumPossibleGoldCurrency(Environmental mine,
java.lang.String moneyStr) |
For cases when a string input probably contains an amount of money,
this method is used to determine the currency id.
|
double |
parseNumPossibleGoldDenomination(Environmental mine,
java.lang.String currency,
java.lang.String moneyStr) |
For cases when a string input probably contains an amount of money,
this method is used to determine the denomination.
|
Item |
parsePossibleContainer(MOB mob,
java.util.List<java.lang.String> commands,
boolean withStuff,
Filterer<Environmental> filter) |
Attempts to determine if the given user command input is specifying a container
as the last argument, for cases when that would be possible.
|
java.util.List<Container> |
parsePossibleContainers(MOB mob,
java.util.List<java.lang.String> commands,
Filterer<Environmental> filter,
boolean withContentOnly) |
Attempts to determine if the given user command input is specifying
one or more containers, for cases when that would be possible.
|
Item |
parsePossibleRoomGold(MOB seer,
Room room,
Container container,
java.lang.String moneyStr) |
Attempts to determine if the given user input specifies an amount
of currency in the given room, and if so, returns that precise
amount parsed from the rooms existing currency.
|
Environmental |
parseShopkeeper(MOB mob,
java.util.List<java.lang.String> matchWords,
java.lang.String fromTo,
java.lang.String error) |
Returns a matching shopkeeper from a given and his/her location, or null.
|
java.lang.Long |
parseSpaceDistance(java.lang.String dist) |
Returns the distance in decameters represented by the given
parsable user-entered string.
|
java.util.List<java.lang.String> |
parseWords(java.lang.String thisStr) |
Strips out all punctuation and returns the individual words in
an english sentence.
|
boolean |
preInvokeSkill(MOB mob,
java.util.List<java.lang.String> commands,
int secondsElapsed,
double actionsRemaining) |
Given a user input array, this method will find the skill that is trying to be
invoked by the commands, but which cannot be due to insufficient action points,
and then call preinvoke on it.
|
int |
probabilityOfBeingEnglish(java.lang.String str) |
Returns the probability 0-100 of the given string being
english.
|
java.lang.String |
properIndefiniteArticle(java.lang.String str) |
Returns the proper indefinite article -- a or an, for
the given noun or noun-phrase.
|
java.lang.String |
removeArticleLead(java.lang.String s) |
If the given phrase begins with an article word
such as a, an, some, etc..
|
java.lang.String |
sizeDescShort(long size) |
Returns [best distance] for the given number.
|
protected int |
skipSpaces(java.lang.String paragraph,
int index) |
|
java.lang.String |
spaceOutPunctuation(java.lang.String str) |
Returns the given string with any
punctuation changed into spaces.
|
java.lang.String |
speedDescShort(double speed) |
Rounds the given speed and returns [speed]/sec
|
boolean |
startsWithAnArticle(java.lang.String s) |
Returns whether the given word or
phrase starts with an article, such as
a, an, the, some, etc..
|
boolean |
startsWithAnIndefiniteArticle(java.lang.String s) |
Returns whether the given word or
phrase starts with an indefinite article, such as
a, an, some, etc..
|
java.lang.String |
startWithAorAn(java.lang.String str) |
Returns the proper indefinite article for the given word/phrase
|
java.lang.String |
stringifyElapsedTimeOrTicks(long millis,
long ticks) |
Converts the given number of milliseconds into ms, s, m, h, d, etc...
|
java.lang.String |
stripEnglishPunctuation(java.lang.String str) |
Returns the given string with normal punctuation
removed.
|
java.lang.String |
stripPunctuation(java.lang.String str) |
Returns the given string with extended
punctuation removed.
|
java.lang.String |
toEnglishStringList(java.lang.Class<? extends java.lang.Enum<?>> enumer,
boolean andOr) |
Returns comma-space delimited list of the given emum names.
|
java.lang.String |
toEnglishStringList(java.lang.String[] V,
boolean andOr) |
Returns comma-space delimited list of the given objects.toString().
|
java.lang.String |
toEnglishStringList(java.util.Collection<? extends java.lang.Object> V) |
Returns comma-space delimited list of the given objects.toString().
|
protected boolean |
unsafeContainsString(char[] toSrchC,
java.lang.String srchForStr) |
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, shutdown, tick
public static boolean[] PUNCTUATION_TABLE
public static boolean[] NARROW_PUNCTUATION_TABLE
public static final java.lang.String[] ARTICLES
public static final java.lang.String[] INDARTICLES
public static final char[] ALL_CHRS
public static final java.lang.String[] fwords
public static final java.lang.String[] frwords
public static final java.lang.String[] fnouns
public static final java.lang.String[] feewords1
public static final java.lang.String[] feewords2
public static final java.lang.String[] num_words
public static final java.lang.String[] num_words_10
public static final java.lang.String[] num_words_x
public static final java.lang.String[] numth_words
public static final java.util.List<Environmental> empty
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public java.lang.String toEnglishStringList(java.lang.String[] V, boolean andOr)
EnglishParsing
toEnglishStringList
in interface EnglishParsing
V
- the collection of things to treat as stringsandOr
- true to connect with AND, false for ORpublic java.lang.String toEnglishStringList(java.lang.Class<? extends java.lang.Enum<?>> enumer, boolean andOr)
EnglishParsing
toEnglishStringList
in interface EnglishParsing
enumer
- the collection of things to treat as stringsandOr
- true to use AND, false to use ORpublic java.lang.String toEnglishStringList(java.util.Collection<? extends java.lang.Object> V)
EnglishParsing
toEnglishStringList
in interface EnglishParsing
V
- the collection of things to treat as stringsprotected java.lang.String makeLowNumberWords(short num, boolean and)
public java.lang.String makeNumberthWords(int num)
EnglishParsing
makeNumberthWords
in interface EnglishParsing
num
- the num to translatepublic java.lang.String makeNumberWords(double num, int precision)
EnglishParsing
makeNumberWords
in interface EnglishParsing
num
- the numberprecision
- the number of digits less than 0public java.lang.String makePastTense(java.lang.String word, java.lang.String defaultWord)
EnglishParsing
makePastTense
in interface EnglishParsing
word
- the word to past-tensizedefaultWord
- the word to use if none givenpublic boolean isAnArticle(java.lang.String s)
EnglishParsing
isAnArticle
in interface EnglishParsing
s
- the string to checkEnglishParsing.isAnIndefiniteArticle(String)
,
EnglishParsing.startsWithAnArticle(String)
,
EnglishParsing.startsWithAnIndefiniteArticle(String)
public boolean isAnIndefiniteArticle(java.lang.String s)
EnglishParsing
isAnIndefiniteArticle
in interface EnglishParsing
s
- the string to checkEnglishParsing.isAnArticle(String)
,
EnglishParsing.startsWithAnArticle(String)
,
EnglishParsing.startsWithAnIndefiniteArticle(String)
public java.lang.String makePlural(java.lang.String str)
EnglishParsing
makePlural
in interface EnglishParsing
str
- the word to pluralizepublic java.lang.String makeSingular(java.lang.String str)
EnglishParsing
makeSingular
in interface EnglishParsing
str
- the word to de-pluralizepublic java.lang.String cleanPrepositions(java.lang.String s)
EnglishParsing
cleanPrepositions
in interface EnglishParsing
s
- the string to cleanpublic java.lang.String properIndefiniteArticle(java.lang.String str)
EnglishParsing
properIndefiniteArticle
in interface EnglishParsing
str
- the noun or noun phraseprotected java.lang.String getBestDistance(long d)
public java.lang.String sizeDescShort(long size)
EnglishParsing
sizeDescShort
in interface EnglishParsing
size
- the full dm distanceEnglishParsing.distanceDescShort(long)
public java.lang.String distanceDescShort(long distance)
EnglishParsing
distanceDescShort
in interface EnglishParsing
distance
- the full dm distanceEnglishParsing.sizeDescShort(long)
public java.lang.String coordDescShort(long[] coords)
EnglishParsing
coordDescShort
in interface EnglishParsing
coords
- the 3-absolute coordsEnglishParsing.sizeDescShort(long)
public java.lang.String speedDescShort(double speed)
EnglishParsing
speedDescShort
in interface EnglishParsing
speed
- the raw speed doublepublic java.lang.String directionDescShort(double[] dir)
EnglishParsing
directionDescShort
in interface EnglishParsing
dir
- the direction in radiansEnglishParsing.directionDescShortest(double[])
public java.lang.String directionDescShortest(double[] dir)
EnglishParsing
directionDescShortest
in interface EnglishParsing
dir
- the direction in radiansEnglishParsing.directionDescShort(double[])
public java.lang.Long parseSpaceDistance(java.lang.String dist)
EnglishParsing
parseSpaceDistance
in interface EnglishParsing
dist
- the user-entered stringpublic java.lang.String getFirstWord(java.lang.String str)
EnglishParsing
getFirstWord
in interface EnglishParsing
str
- the phrase to look inpublic java.lang.String startWithAorAn(java.lang.String str)
EnglishParsing
startWithAorAn
in interface EnglishParsing
str
- the word/phrase that needs an indefinite articlepublic boolean startsWithAnArticle(java.lang.String s)
EnglishParsing
startsWithAnArticle
in interface EnglishParsing
s
- the string to checkEnglishParsing.isAnArticle(String)
,
EnglishParsing.isAnIndefiniteArticle(String)
,
EnglishParsing.startsWithAnIndefiniteArticle(String)
public boolean startsWithAnIndefiniteArticle(java.lang.String s)
EnglishParsing
startsWithAnIndefiniteArticle
in interface EnglishParsing
s
- the string to checkEnglishParsing.isAnArticle(String)
,
EnglishParsing.isAnIndefiniteArticle(String)
,
EnglishParsing.startsWithAnArticle(String)
public java.lang.String removeArticleLead(java.lang.String s)
EnglishParsing
removeArticleLead
in interface EnglishParsing
s
- the string to cleanpublic java.lang.String insertUnColoredAdjective(java.lang.String str, java.lang.String adjective)
EnglishParsing
insertUnColoredAdjective
in interface EnglishParsing
str
- the word or noun phraseadjective
- the adjective to addprotected int skipSpaces(java.lang.String paragraph, int index)
public java.lang.String insertAdjectives(java.lang.String paragraph, java.lang.String[] adjsToChoose, int pctChance)
EnglishParsing
insertAdjectives
in interface EnglishParsing
paragraph
- The paragraph with nouns after articlesadjsToChoose
- the list of adjectives to choose frompctChance
- the pct chance that any particular noun gets an adjectivepublic Social findSocial(MOB mob, java.util.List<java.lang.String> commands, boolean exactOnly)
public CMObject findCommand(MOB mob, java.util.List<java.lang.String> commands)
EnglishParsing
findCommand
in interface EnglishParsing
mob
- the player/mob trying to invoke a commandcommands
- the user input array of the invocationprotected boolean evokedBy(Ability thisAbility, java.lang.String thisWord)
protected java.lang.String collapsedName(Ability thisAbility)
protected boolean evokedBy(Ability thisAbility, java.lang.String thisWord, java.lang.String secondWord)
public java.lang.String getSkillInvokeWord(MOB mob, java.lang.String word)
EnglishParsing
getSkillInvokeWord
in interface EnglishParsing
mob
- the player/mob trying to invoke a skillword
- the user input of the invocationpublic Ability getSkillToInvoke(MOB mob, java.util.List<java.lang.String> commands)
EnglishParsing
getSkillToInvoke
in interface EnglishParsing
mob
- the player/mob trying to invoke a skillcommands
- the user input array of the invocationpublic boolean preInvokeSkill(MOB mob, java.util.List<java.lang.String> commands, int secondsElapsed, double actionsRemaining)
EnglishParsing
preInvokeSkill
in interface EnglishParsing
mob
- the player mob trying to use a skillcommands
- the skill command words and argumentssecondsElapsed
- the seconds ellapsed since initial attemptactionsRemaining
- the additional action points requiredpublic void invokeSkill(MOB mob, java.util.List<java.lang.String> commands)
EnglishParsing
invokeSkill
in interface EnglishParsing
mob
- the player/mob trying to invoke a skillcommands
- the user input array of the invocationpublic boolean isPunctuation(byte b)
EnglishParsing
isPunctuation
in interface EnglishParsing
b
- the byte to checkpublic boolean isEnglishPunctuation(byte b)
EnglishParsing
isEnglishPunctuation
in interface EnglishParsing
b
- the byte to checkpublic boolean hasEnglishPunctuation(java.lang.String str)
EnglishParsing
hasEnglishPunctuation
in interface EnglishParsing
str
- the string to checkpublic java.lang.String stripEnglishPunctuation(java.lang.String str)
EnglishParsing
stripEnglishPunctuation
in interface EnglishParsing
str
- the string to checkpublic boolean hasPunctuation(java.lang.String str)
EnglishParsing
hasPunctuation
in interface EnglishParsing
str
- the string to checkpublic java.lang.String stripPunctuation(java.lang.String str)
EnglishParsing
stripPunctuation
in interface EnglishParsing
str
- the string to checkpublic java.lang.String spaceOutPunctuation(java.lang.String str)
EnglishParsing
spaceOutPunctuation
in interface EnglishParsing
str
- the string to convertpublic java.util.List<java.lang.String> parseWords(java.lang.String thisStr)
EnglishParsing
parseWords
in interface EnglishParsing
thisStr
- the sentencepublic boolean equalsPunctuationless(char[] strC, char[] str2C)
public boolean containsOneOfString(java.lang.String toSrchStr, java.util.List<java.lang.String> srchForStrs)
EnglishParsing
containsOneOfString
in interface EnglishParsing
toSrchStr
- the string to search inside ofsrchForStrs
- the strings to search forpublic boolean containsString(java.lang.String toSrchStr, java.lang.String srchForStr)
EnglishParsing
containsString
in interface EnglishParsing
toSrchStr
- the string to search throughsrchForStr
- the string to search for in the first stringprotected final boolean unsafeContainsString(char[] toSrchC, java.lang.String srchForStr)
public java.lang.String bumpDotContextNumber(java.lang.String srchStr, int thisMuch)
EnglishParsing
bumpDotContextNumber
in interface EnglishParsing
srchStr
- the context namethisMuch
- the amount to adjust by, + or -public int getContextDotNumber(java.lang.String srchStr)
EnglishParsing
getContextDotNumber
in interface EnglishParsing
srchStr
- the context-specific namepublic int getContextNumber(ItemCollection cont, Environmental E)
EnglishParsing
getContextNumber
in interface EnglishParsing
cont
- the collection containing the environmentalE
- the object to find in the collectionpublic int getContextNumber(Environmental[] list, Environmental E)
EnglishParsing
getContextNumber
in interface EnglishParsing
list
- the list containing the environmentalE
- the object to find in the listpublic int getContextNumber(java.util.Collection<? extends Environmental> list, Environmental E)
EnglishParsing
getContextNumber
in interface EnglishParsing
list
- the collection containing the environmentalE
- the object to find in the collectionpublic int getContextSameNumber(ItemCollection cont, Environmental E)
EnglishParsing
getContextSameNumber
in interface EnglishParsing
cont
- the collection to find a match inE
- the environmental to find in the collectionpublic int getContextSameNumber(Environmental[] list, Environmental E)
EnglishParsing
getContextSameNumber
in interface EnglishParsing
list
- the collection to find a match inE
- the environmental to find in the collectionpublic int getContextSameNumber(java.util.Collection<? extends Environmental> list, Environmental E)
EnglishParsing
getContextSameNumber
in interface EnglishParsing
list
- the list to find a match inE
- the environmental to find in the collectionpublic java.lang.String getContextName(ItemCollection cont, Environmental E)
EnglishParsing
getContextName
in interface EnglishParsing
cont
- the collection containing the environmentalE
- the object to find in the collectionpublic java.lang.String getContextName(Environmental[] list, Environmental E)
EnglishParsing
getContextName
in interface EnglishParsing
list
- the list containing the environmentalE
- the object to find in the listpublic java.lang.String getContextName(java.util.Collection<? extends Environmental> list, Environmental E)
EnglishParsing
getContextName
in interface EnglishParsing
list
- the collection containing the environmentalE
- the object to find in the collectionpublic java.util.List<java.lang.String> getAllContextNames(java.util.Collection<? extends Environmental> list, Filterer<Environmental> filter)
EnglishParsing
getAllContextNames
in interface EnglishParsing
list
- the list of objects to return the names offilter
- an optional filter, or nullpublic java.lang.String getContextSameName(ItemCollection cont, Environmental E)
EnglishParsing
getContextSameName
in interface EnglishParsing
cont
- the collection to find a match inE
- the environmental to find in the collectionpublic java.lang.String getContextSameName(Environmental[] list, Environmental E)
EnglishParsing
getContextSameName
in interface EnglishParsing
list
- the collection to find a match inE
- the environmental to find in the collectionpublic java.lang.String getContextSameName(java.util.Collection<? extends Environmental> list, Environmental E)
EnglishParsing
getContextSameName
in interface EnglishParsing
list
- the collection to find a match inE
- the environmental to find in the collectionpublic Environmental parseShopkeeper(MOB mob, java.util.List<java.lang.String> matchWords, java.lang.String fromTo, java.lang.String error)
EnglishParsing
parseShopkeeper
in interface EnglishParsing
mob
- the mob looking for a shopkeeper nearbymatchWords
- the search words, possibly modifiedfromTo
- whether from or to is the proper separatorerror
- the error message to send for bad argumentspublic java.util.List<Item> fetchItemList(ItemPossessor from, MOB mob, Item container, java.util.List<java.lang.String> matchWords, Filterer<Environmental> filter, boolean visionMatters)
EnglishParsing
fetchItemList
in interface EnglishParsing
from
- The room or mob that possess items to select.mob
- the mob in the room, or the viewer of the itemscontainer
- the required container that the items should be in, or nullmatchWords
- the words that must be matched to select an itemfilter
- the required filter for itemsvisionMatters
- true if the items must be seen by the mob, or false otherwisepublic long parseNumPossibleGold(Environmental mine, java.lang.String moneyStr)
EnglishParsing
parseNumPossibleGold
in interface EnglishParsing
mine
- someone with money, like a mob, or nullmoneyStr
- a user input string to parsepublic java.lang.String parseNumPossibleGoldCurrency(Environmental mine, java.lang.String moneyStr)
EnglishParsing
parseNumPossibleGoldCurrency
in interface EnglishParsing
mine
- someone with money, like a mob, or nullmoneyStr
- a user input string to parsepublic long getMillisMultiplierByName(java.lang.String timeName)
EnglishParsing
getMillisMultiplierByName
in interface EnglishParsing
timeName
- an amount of time wordpublic double parseNumPossibleGoldDenomination(Environmental mine, java.lang.String currency, java.lang.String moneyStr)
EnglishParsing
parseNumPossibleGoldDenomination
in interface EnglishParsing
mine
- someone with money, like a mob, or nullcurrency
- currency to use if mine is unavailmoneyStr
- a user input string to parsepublic java.lang.String matchAnyCurrencySet(java.lang.String moneyStr)
EnglishParsing
matchAnyCurrencySet
in interface EnglishParsing
moneyStr
- the user input that contains a denominationpublic double matchAnyDenomination(java.lang.String currency, java.lang.String moneyStr)
EnglishParsing
matchAnyDenomination
in interface EnglishParsing
currency
- currency id, or null will check all currencies, but why?moneyStr
- the user input that contains a denominationpublic Item parsePossibleRoomGold(MOB seer, Room room, Container container, java.lang.String moneyStr)
EnglishParsing
parsePossibleRoomGold
in interface EnglishParsing
seer
- the player looking to get some moneyroom
- the room the money is incontainer
- the container the money is in, or nullmoneyStr
- the user inputpublic Item parseBestPossibleGold(MOB mob, Container container, java.lang.String itemID)
EnglishParsing
parseBestPossibleGold
in interface EnglishParsing
mob
- the player looking to give away their moneycontainer
- the container it must be in, or nullitemID
- the user inputpublic java.util.List<Container> parsePossibleContainers(MOB mob, java.util.List<java.lang.String> commands, Filterer<Environmental> filter, boolean withContentOnly)
EnglishParsing
parsePossibleContainers
in interface EnglishParsing
mob
- the player whose commands are parsedcommands
- the commands to parse and checkfilter
- filter for allowed containers, or nullwithContentOnly
- true if the container must not be emptypublic Item parsePossibleContainer(MOB mob, java.util.List<java.lang.String> commands, boolean withStuff, Filterer<Environmental> filter)
EnglishParsing
parsePossibleContainer
in interface EnglishParsing
mob
- the player whose commands are parsedcommands
- the commands to parse and checkwithStuff
- true if the container must not be emptyfilter
- filter for allowed containers, or nullpublic java.lang.String stringifyElapsedTimeOrTicks(long millis, long ticks)
EnglishParsing
stringifyElapsedTimeOrTicks
in interface EnglishParsing
millis
- the number of ellapsed milliseconds to convertticks
- the number of ticks to average ms bypublic Triad<java.lang.String,java.lang.Double,java.lang.Long> parseMoneyStringSDL(MOB mob, java.lang.String moneyStr, java.lang.String correctCurrency)
EnglishParsing
parseMoneyStringSDL
in interface EnglishParsing
mob
- the user to use to find the right currencymoneyStr
- the parsable user inputcorrectCurrency
- a currency id to use, or null to use mob abovepublic int parseMaxToGive(MOB mob, java.util.List<java.lang.String> commands, boolean breakPackages, Environmental checkWhat, boolean getOnly)
EnglishParsing
parseMaxToGive
in interface EnglishParsing
mob
- the player to parse commands fromcommands
- the parsed input from the userbreakPackages
- true to allow package breakingcheckWhat
- Possessor (MOB or Room) to check.getOnly
- true if getting from a roompublic int probabilityOfBeingEnglish(java.lang.String str)
EnglishParsing
probabilityOfBeingEnglish
in interface EnglishParsing
str
- the text to inspectpublic EnglishParser.FetchFlags fetchFlags(java.lang.String srchStr)
protected java.lang.String cleanExtraneousDollarMarkers(java.lang.String srchStr)
public Environmental fetchEnvironmental(java.lang.Iterable<? extends Environmental> list, java.lang.String srchStr, boolean exactOnly)
EnglishParsing
fetchEnvironmental
in interface EnglishParsing
list
- the collection of environmental objects to search throughsrchStr
- the search stringexactOnly
- true for exact matching, false for inexactpublic <T> T fetchReflective(java.lang.Iterable<T> list, java.lang.String srchStr, java.lang.String methodName, boolean exactOnly)
EnglishParsing
fetchReflective
in interface EnglishParsing
T
- the matching T objectlist
- the collection of environmental objects to search throughsrchStr
- the search stringmethodName
- the method to match againstexactOnly
- true for exact matching, false for inexactpublic Exit fetchExit(java.lang.Iterable<? extends Environmental> list, java.lang.String srchStr, boolean exactOnly)
EnglishParsing
fetchExit
in interface EnglishParsing
list
- the collection of exit objects to search throughsrchStr
- the search stringexactOnly
- true for exact matching, false for inexactpublic Environmental fetchEnvironmental(java.util.Iterator<? extends Environmental> iter, java.lang.String srchStr, boolean exactOnly)
EnglishParsing
fetchEnvironmental
in interface EnglishParsing
iter
- the iterator of objects to search throughsrchStr
- the search stringexactOnly
- true for exact matching, false for inexactpublic Environmental fetchEnvironmental(java.util.Enumeration<? extends Environmental> iter, java.lang.String srchStr, boolean exactOnly)
EnglishParsing
fetchEnvironmental
in interface EnglishParsing
iter
- the enumeraton of environmental objects to search throughsrchStr
- the search stringexactOnly
- true for exact matching, false for inexactpublic java.util.List<Environmental> fetchEnvironmentals(java.util.List<? extends Environmental> list, java.lang.String srchStr, boolean exactOnly)
EnglishParsing
fetchEnvironmentals
in interface EnglishParsing
list
- the list of objects to search throughsrchStr
- the search stringexactOnly
- true for exact matching, false for inexactpublic Environmental fetchEnvironmental(java.util.Map<java.lang.String,? extends Environmental> list, java.lang.String srchStr, boolean exactOnly)
EnglishParsing
fetchEnvironmental
in interface EnglishParsing
list
- the map of environmental objects to search throughsrchStr
- the search stringexactOnly
- true for exact matching, false for inexactpublic Item fetchAvailableItem(java.util.List<Item> list, java.lang.String srchStr, Item goodLocation, Filterer<Environmental> filter, boolean exactOnly)
EnglishParsing
fetchAvailableItem
in interface EnglishParsing
list
- the list of items to search throughsrchStr
- the search stringgoodLocation
- a container, or nullfilter
- the required filterexactOnly
- true for exact matching, false for inexactpublic java.util.List<Item> fetchAvailableItems(java.util.List<Item> list, java.lang.String srchStr, Item goodLocation, Filterer<Environmental> filter, boolean exactOnly)
EnglishParsing
fetchAvailableItems
in interface EnglishParsing
list
- the list of items to search throughsrchStr
- the search stringgoodLocation
- a container, or nullfilter
- the required filterexactOnly
- true for exact matching, false for inexactpublic Environmental fetchAvailable(java.util.Collection<? extends Environmental> list, java.lang.String srchStr, Item goodLocation, Filterer<Environmental> filter, boolean exactOnly, int[] counterSlap)
EnglishParsing
fetchAvailable
in interface EnglishParsing
list
- the list of objects to search throughsrchStr
- the search stringgoodLocation
- a container, or nullfilter
- the required filterexactOnly
- true for exact matching, false for inexactcounterSlap
- a one-dimensional array, usually with 0public Environmental fetchAvailable(java.util.Collection<? extends Environmental> list, java.lang.String srchStr, Item goodLocation, Filterer<Environmental> filter, boolean exactOnly)
EnglishParsing
fetchAvailable
in interface EnglishParsing
list
- the list of objects to search throughsrchStr
- the search stringgoodLocation
- a container, or nullfilter
- the required filterexactOnly
- true for exact matching, false for inexact