Commit 1692273d authored by coppro's avatar coppro

Updated dictionary

Added new <nospellcheck> tag, to prevent spell-checking of words within.
Prevented spellchecking of anything a) matching a keyword or b) formed from a cardname atom
Replaced ` as LEGENDNAME alternative; I think it's a bug that it's gone
parent 3b0ae6de
33 33
mana mana
untap/MSDRJZG untap/MSDRJZG
face-down planeswalker
noncreature
nonland
nonenchantment
nonartifact
nonwhite nonwhite
nonblue nonblue
nonblack nonblack
nonred nonred
nongreen nongreen
non-land
unblock/USDG unblock/USDG
precombat precombat
postcombat postcombat
scry scry
Plainswalk plainswalk
Islandwalk islandwalk
Swampwalk swampwalk
Mountainwalk mountainwalk
Forestwalk forestwalk
Landwalk landwalk
Desertwalk desertwalk
Plainshome plainshome
Islandhome islandhome
Swamphome swamphome
Mountainhome mountainhome
Foresthome foresthome
Landhome landhome
Soulshift soulshift
Ninjitsu ninjitsu
Bushido bushido
Lifelink lifelink
Gravestorm gravestorm
Fateseal fateseal
Bloodthirst bloodthirst

############################################################## Localization ############################################################## Localization
include file: language include file: language
...@@ -310,7 +310,7 @@ for_mana_costs := format_cost := { ...@@ -310,7 +310,7 @@ for_mana_costs := format_cost := {
} }
# Convert first character to lower case # Convert first character to lower case
alternative_cost := replace@(match:"^[A-Z]", replace: { to_lower() }) alternative_cost := replace@(match:"^[A-Z]", replace: { to_lower() })
# #
combined_cost := replace@(match:", [A-Z]", replace: { to_lower() })+ combined_cost := replace@(match:", [A-Z]", replace: { to_lower() })+
replace@(match:",", replace:" and")+ replace@(match:",", replace:" and")+
replace@(match:"^[STQXYZIWUBRG0-9/|]", in_context: "(^|[[:space:]])<match>", replace: "<sym-auto>&</sym-auto>")+ replace@(match:"^[STQXYZIWUBRG0-9/|]", in_context: "(^|[[:space:]])<match>", replace: "<sym-auto>&</sym-auto>")+
...@@ -341,7 +341,7 @@ mana_context := ...@@ -341,7 +341,7 @@ mana_context :=
([ ]either)? # pay either X or Y ([ ]either)? # pay either X or Y
([ ](<sym[^>]*>)?[STQXYZIWUBRG0-9/|]+(</sym[^>]*>)?,)* # pay X, Y or Z ([ ](<sym[^>]*>)?[STQXYZIWUBRG0-9/|]+(</sym[^>]*>)?,)* # pay X, Y or Z
([ ](<sym[^>]*>)?[STQXYZIWUBRG0-9/|]+(</sym[^>]*>)?[ ](and|or|and/or))* # pay X or Y ([ ](<sym[^>]*>)?[STQXYZIWUBRG0-9/|]+(</sym[^>]*>)?[ ](and|or|and/or))* # pay X or Y
[ ]<match> [ ]<match>
([,.)]|$ # (end of word) ([,.)]|$ # (end of word)
|[ ][^ .,]*$ # still typing... |[ ][^ .,]*$ # still typing...
|[ ]( or | and | in | less | more | to ) # or next word is ... |[ ]( or | and | in | less | more | to ) # or next word is ...
...@@ -379,8 +379,8 @@ text_filter := ...@@ -379,8 +379,8 @@ text_filter :=
chosen(choice:if correct_case then mode else "lower case", set.automatic_reminder_text) chosen(choice:if correct_case then mode else "lower case", set.automatic_reminder_text)
}, },
combine: { combine: {
if mode == "pseudo" then "<i-auto>{keyword}</i-auto>" if mode == "pseudo" then "<i-auto><nospellcheck>{keyword}</nospellcheck></i-auto>"
else "{keyword}<atom-reminder-{mode}> ({process_english_hints(reminder)})</atom-reminder-{mode}>" } else "<nospellcheck>{keyword}</nospellcheck><atom-reminder-{mode}> ({process_english_hints(reminder)})</atom-reminder-{mode}>" }
) + ) +
# step 2b : move action keywords' reminder text to the end of the line # step 2b : move action keywords' reminder text to the end of the line
replace@( replace@(
...@@ -400,18 +400,18 @@ text_filter := ...@@ -400,18 +400,18 @@ text_filter :=
) + ) +
# step 3b : expand shortcut words ` and shortened LEGENDNAME # step 3b : expand shortcut words ` and shortened LEGENDNAME
replace@( replace@(
match: "LEGENDNAME", match: "`|`THIS`|LEGENDNAME",
in_context: "(^|[[:space:]]|\\()<match>", # TODO: Allow any punctuation before in_context: "(^|[[:space:]]|\\()<match>", # TODO: Allow any punctuation before
replace: "<atom-legname></atom-legname>" replace: "<atom-legname></atom-legname>"
) + ) +
# step 3c : fill in atom fields # step 3c : fill in atom fields
tag_contents@( tag_contents@(
tag: "<atom-cardname>", tag: "<atom-cardname>",
contents: { if card_name=="" then "CARDNAME" else card_name } contents: { "<nospellcheck>" + (if card_name=="" then "CARDNAME" else card_name) + "</nospellcheck>" }
) + ) +
tag_contents@( tag_contents@(
tag: "<atom-legname>", tag: "<atom-legname>",
contents: { if card_name=="" then "LEGENDNAME" else legend_filter(card_name) } contents: { "<nospellcheck>" + (if card_name=="" then "LEGENDNAME" else legend_filter(card_name)) + "</nospellcheck>" }
) + ) +
# step 4 : explict non mana symbols # step 4 : explict non mana symbols
replace@( replace@(
...@@ -439,7 +439,7 @@ text_filter := ...@@ -439,7 +439,7 @@ text_filter :=
replace: { _1 + to_upper(_2) }) + replace: { _1 + to_upper(_2) }) +
curly_quotes + curly_quotes +
# step 9 : spellcheck # step 9 : spellcheck
{ if set.mark_errors then { if set.mark_errors then
check_spelling( check_spelling(
language: language().spellcheck_code, language: language().spellcheck_code,
extra_dictionary: "/magic.mse-game/magic-words", extra_dictionary: "/magic.mse-game/magic-words",
......
...@@ -20,8 +20,10 @@ inline size_t spelled_correctly(const String& input, size_t start, size_t end, S ...@@ -20,8 +20,10 @@ inline size_t spelled_correctly(const String& input, size_t start, size_t end, S
String word = untag(input.substr(start,end-start)); String word = untag(input.substr(start,end-start));
if (word.empty()) return true; if (word.empty()) return true;
// symbol? // symbol?
if (in_tag(input,_("<sym"),start,end) != String::npos) { if (in_tag(input,_("<sym"),start,end) != String::npos ||
in_tag(input,_("<nospellcheck"),start,end) != String::npos) {
// symbols are always spelled correctly // symbols are always spelled correctly
// and <nospellcheck> tags should prevent spellcheck
return true; return true;
} }
// run through spellchecker(s) // run through spellchecker(s)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment