Editing Module:Data/namespaces/videoGames/static/name
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
This page is not enabled for semantic in-text annotations due to namespace restrictions. Details about how to enable the namespace can be found on the configuration help page.
Latest revision | Your text | ||
Line 10: | Line 10: | ||
:lower() | :lower() | ||
-- Replace roman numerals: | -- Replace roman numerals: | ||
− | :gsub( | + | :gsub( ' viii[!: ]', '8' ) |
− | :gsub( | + | :gsub( ' vii[!: ]', '7' ) |
− | :gsub( | + | :gsub( ' vi[!: ]', '6' ) |
− | :gsub( | + | :gsub( ' v[!: ]', '5' ) |
− | :gsub( | + | :gsub( ' iv[!: ]', '4' ) |
− | :gsub( | + | :gsub( ' iii[!: ]', '3' ) |
− | :gsub( | + | :gsub( ' ii[!: ]', '2' ) |
− | :gsub( | + | :gsub( ' i[!: ]', '1' ) |
-- Remove a bunch of commonly used characters: | -- Remove a bunch of commonly used characters: | ||
:gsub( "[%s%-_'/:! ]", '' ) | :gsub( "[%s%-_'/:! ]", '' ) | ||
-- Remove series names: | -- Remove series names: | ||
− | :gsub( | + | :gsub( 'yugioh', '' ) |
− | :gsub( | + | :gsub( '5ds', '' ) |
− | :gsub( | + | :gsub( 'zexal', '' ) |
− | :gsub( | + | :gsub( 'arcv', '' ) |
− | :gsub( | + | :gsub( 'vrains', '' ) |
− | |||
-- Remove some redundant words: | -- Remove some redundant words: | ||
− | :gsub( | + | :gsub( 'the', '' ) |
− | :gsub( | + | :gsub( 'gameboy', '' ) |
− | |||
-- Normalize some titles: | -- Normalize some titles: | ||
− | :gsub( | + | :gsub( 'expert', 'ex' ) |
:gsub( 'worldchampionshiptournament', 'worldchampionship' ) | :gsub( 'worldchampionshiptournament', 'worldchampionship' ) | ||
− | -- Remove "gx | + | -- Remove "gx", if it's large enough (preserve "gx01", "gx3", "ygoo", "ygo" ): |
if normalizedV:len() > 4 then | if normalizedV:len() > 4 then | ||
normalizedV = normalizedV | normalizedV = normalizedV | ||
Line 44: | Line 42: | ||
if normalizedV:len() > 13 then | if normalizedV:len() > 13 then | ||
normalizedV = normalizedV:gsub( 'duelmonsters', '' ) | normalizedV = normalizedV:gsub( 'duelmonsters', '' ) | ||
− | |||
-- Remove "worldchampionship", if it's large enough (preserve cases like /worldchampionship20\d\d/): | -- Remove "worldchampionship", if it's large enough (preserve cases like /worldchampionship20\d\d/): | ||
if normalizedV:len() > 21 then | if normalizedV:len() > 21 then | ||
Line 51: | Line 48: | ||
end | end | ||
end | end | ||
− | + | mw.log( normalizedV ) | |
return normalizedV | return normalizedV | ||
end | end |