diff --git a/data/magic.mse-game/language b/data/magic.mse-game/language index 8b9432e5..f6887c60 100644 --- a/data/magic.mse-game/language +++ b/data/magic.mse-game/language @@ -4,6 +4,7 @@ languages := [ English: [ code : "en", + spellcheck_code : "en_US", pt_separator : "/", type_separator : " — ", subtype_separator : " ", @@ -17,6 +18,7 @@ languages := [ Français: [ code : "fr", + spellcheck_code : "", # TODO: get dictionary pt_separator : "/", type_separator : " : " subtype_separator : " et ", diff --git a/data/magic.mse-game/script b/data/magic.mse-game/script index 00101469..45e08daa 100644 --- a/data/magic.mse-game/script +++ b/data/magic.mse-game/script @@ -322,8 +322,8 @@ mana_context := |adds?|pay(ed)?[ ](with|using) ) ([ ]either)? # pay either X or Y - ([ ]]*>[STQXYZIWUBRG0-9/|]+]*>,)* # pay X, Y or Z - ([ ]]*>[STQXYZIWUBRG0-9/|]+]*>[ ](and|or|and/or))* # pay X or Y + ([ ](]*>)?[STQXYZIWUBRG0-9/|]+(]*>)?,)* # pay X, Y or Z + ([ ](]*>)?[STQXYZIWUBRG0-9/|]+(]*>)?[ ](and|or|and/or))* # pay X or Y [ ] ([,.)]|$ # (end of word) |[ ][^ .,]*$ # still typing... @@ -343,6 +343,7 @@ text_filter := # step 1 : remove all automatic tags remove_tag@(tag: "") + remove_tag@(tag: "") + + remove_tag@(tag: "" + mana_filter_t() + ""} ) + # step 5 : add mana & tap symbols replace@( - match: "\b[STQXYZIWUBRG0-9/|]+\b", + match: "\\b[STQXYZIWUBRG0-9/|]+\\b", in_context: mana_context, replace: {"" + mana_filter_t() + ""} ) + # step 5b : add explict mana symbols @@ -410,7 +411,9 @@ text_filter := + "([[:lower:]])" # match this + "(?![)])", # not followed by this replace: { _1 + to_upper(_2) }) + - curly_quotes + curly_quotes + + # step 9 : spellcheck + { check_spelling(language:language().spellcheck_code) } ############################################################## Other boxes @@ -423,7 +426,9 @@ flavor_text_filter := # step 2 : surround by tags { "" + input + "" } + # curly quotes - curly_quotes + curly_quotes + + # spellcheck + { check_spelling(language:language().spellcheck_code) } # Move the cursor past the separator in the p/t and type boxes type_over_pt := replace@(match:"/$", replace:"") diff --git a/src/script/functions/spelling.cpp b/src/script/functions/spelling.cpp new file mode 100644 index 00000000..0d295670 --- /dev/null +++ b/src/script/functions/spelling.cpp @@ -0,0 +1,92 @@ + +//+----------------------------------------------------------------------------+ +//| Description: Magic Set Editor - Program to make Magic (tm) cards | +//| Copyright: (C) 2001 - 2008 Twan van Laarhoven and "coppro" | +//| License: GNU General Public License 2 or later (see file COPYING) | +//+----------------------------------------------------------------------------+ + +// ----------------------------------------------------------------------------- : Includes + +#include +#include