In this thread, Cool12309 pointed out that the "checkplurals" command could not lookup all items on the Wiki. He made these observations:
Well, checkplurals uses a function in DebugDatabase:
That's pretty simple minded.
I notice that ShowDescriptionList has a public method: getWikiLocation( Object item ) which handles disambiguating skills, effects, and skills. It also looks up the "Wiki Name" modifier for items that have weird characters that the Wiki treats specially. Looking at modifiers.txt, I see the following:
I have the following suggestions:
1) Add "Wiki Name" modifiers to all the other problematic items.
2) Refactor ShowDescriptionList.getWikiLocation( Object item ):
- Create WikiUtilities.getWikiLocation( String name, int type ), where "type" is ITEM_NAME, EFFECT_NAME or SKILL_NAME. This uses the last half of the original method, where it looks up the Wiki Name modifier, if needed, and disambiguates with (item), (effect) or (skill), as needed.
- The original method translates the Object into a name and a constant: ITEM_NAME, EFFECT_NAME, or SKILL_NAME and calls the method in WikiUtilities.
3) Get rid of the method in DebugDatabase and call the method in WikiUtilities.
These are all due to a few things:
- &: The wiki seems to encode the & into &, so the matcher probably is checking & against & and finding them to be different.
- ?: Same as above.
- #: The wiki cannot have # in the title as # is used as an anchor, so the text before the # is the title that is hit when mafia sends a request. The actual title names on the wiki are the item names without the #.
- '' and "": I believe the issue here is something to do with there being two of ' or ", as items with a single ' seem to work fine.
- Skillbooks: Some skillbooks have the same item and skill (and effect) name, so the wiki makes the actual item/skill/effect name a disambig and makes the titles append (item), (skill), and (effect) to the end to differentiate. Easiest way to handle is probably to check if the item name has a corresponding skill name and if so, add " (item)" to the end when requesting the wiki's plural.
- <i></i>: Probably another encoding issue.
Well, checkplurals uses a function in DebugDatabase:
Code:
private static final String constructWikiName( String name )
{
name = StringUtilities.globalStringReplace( StringUtilities.getDisplayName( name ), " ", "_" );
return Character.toUpperCase( name.charAt( 0 ) ) + name.substring( 1 );
}
I notice that ShowDescriptionList has a public method: getWikiLocation( Object item ) which handles disambiguating skills, effects, and skills. It also looks up the "Wiki Name" modifier for items that have weird characters that the Wiki treats specially. Looking at modifiers.txt, I see the following:
Code:
frigid hankyū Cold Damage: +6, Moxie: +2, Wiki Name: "frigid hankyu"
TΤ◊lisman of Baiø‡ Wiki Name: "Bugged baio"
Bash-Ōs cereal Wiki Name: "Bash-Os cereal"
Bash-Ōs boxtop Wiki Name: "Bash-Os boxtop"
El Vibrato punchcard (ATTACK) Wiki Name: "El Vibrato punchcard (115 holes)"
El Vibrato punchcard (BUFF) Wiki Name: "El Vibrato punchcard (129 holes)"
El Vibrato punchcard (BUILD) Wiki Name: "El Vibrato punchcard (165 holes)"
El Vibrato punchcard (DRONE) Wiki Name: "El Vibrato punchcard (182 holes)"
El Vibrato punchcard (FLOOR) Wiki Name: "El Vibrato punchcard (88 holes)"
El Vibrato punchcard (MODIFY) Wiki Name: "El Vibrato punchcard (213 holes)"
El Vibrato punchcard (REPAIR) Wiki Name: "El Vibrato punchcard (97 holes)"
El Vibrato punchcard (SELF) Wiki Name: "El Vibrato punchcard (216 holes)"
El Vibrato punchcard (SPHERE) Wiki Name: "El Vibrato punchcard (104 holes)"
El Vibrato punchcard (TARGET) Wiki Name: "El Vibrato punchcard (142 holes)"
El Vibrato punchcard (WALL) Wiki Name: "El Vibrato punchcard (176 holes)"
1) Add "Wiki Name" modifiers to all the other problematic items.
2) Refactor ShowDescriptionList.getWikiLocation( Object item ):
- Create WikiUtilities.getWikiLocation( String name, int type ), where "type" is ITEM_NAME, EFFECT_NAME or SKILL_NAME. This uses the last half of the original method, where it looks up the Wiki Name modifier, if needed, and disambiguates with (item), (effect) or (skill), as needed.
- The original method translates the Object into a name and a constant: ITEM_NAME, EFFECT_NAME, or SKILL_NAME and calls the method in WikiUtilities.
3) Get rid of the method in DebugDatabase and call the method in WikiUtilities.