From ed16dd6864cb588545a74f0411ff6d1973290aff Mon Sep 17 00:00:00 2001 From: coppro Date: Sat, 3 Jan 2009 06:16:02 +0000 Subject: [PATCH] Updated dictionary Added new 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 git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1288 0fc631ac-6414-0410-93d0-97cfa31319b6 --- data/magic.mse-game/magic-words.en_US.dic | 47 ++++++++++++----------- data/magic.mse-game/script | 18 ++++----- src/script/functions/spelling.cpp | 4 +- 3 files changed, 37 insertions(+), 32 deletions(-) diff --git a/data/magic.mse-game/magic-words.en_US.dic b/data/magic.mse-game/magic-words.en_US.dic index cfb447e6..01df9238 100644 --- a/data/magic.mse-game/magic-words.en_US.dic +++ b/data/magic.mse-game/magic-words.en_US.dic @@ -1,34 +1,37 @@ 33 mana untap/MSDRJZG -face-down +planeswalker +noncreature +nonland +nonenchantment +nonartifact nonwhite nonblue nonblack nonred nongreen -non-land unblock/USDG precombat postcombat scry -Plainswalk -Islandwalk -Swampwalk -Mountainwalk -Forestwalk -Landwalk -Desertwalk -Plainshome -Islandhome -Swamphome -Mountainhome -Foresthome -Landhome -Soulshift -Ninjitsu -Bushido -Lifelink -Gravestorm -Fateseal -Bloodthirst +plainswalk +islandwalk +swampwalk +mountainwalk +forestwalk +landwalk +desertwalk +plainshome +islandhome +swamphome +mountainhome +foresthome +landhome +soulshift +ninjitsu +bushido +lifelink +gravestorm +fateseal +bloodthirst diff --git a/data/magic.mse-game/script b/data/magic.mse-game/script index 4b9988ce..4a3e355e 100644 --- a/data/magic.mse-game/script +++ b/data/magic.mse-game/script @@ -1,4 +1,4 @@ - + ############################################################## Localization include file: language @@ -310,7 +310,7 @@ for_mana_costs := format_cost := { } # Convert first character to lower case alternative_cost := replace@(match:"^[A-Z]", replace: { to_lower() }) -# +# combined_cost := replace@(match:", [A-Z]", replace: { to_lower() })+ replace@(match:",", replace:" and")+ replace@(match:"^[STQXYZIWUBRG0-9/|]", in_context: "(^|[[:space:]])", replace: "&")+ @@ -341,7 +341,7 @@ mana_context := ([ ]either)? # pay either 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... |[ ]( or | and | in | less | more | to ) # or next word is ... @@ -379,8 +379,8 @@ text_filter := chosen(choice:if correct_case then mode else "lower case", set.automatic_reminder_text) }, combine: { - if mode == "pseudo" then "{keyword}" - else "{keyword} ({process_english_hints(reminder)})" } + if mode == "pseudo" then "{keyword}" + else "{keyword} ({process_english_hints(reminder)})" } ) + # step 2b : move action keywords' reminder text to the end of the line replace@( @@ -400,18 +400,18 @@ text_filter := ) + # step 3b : expand shortcut words ` and shortened LEGENDNAME replace@( - match: "LEGENDNAME", + match: "`|`THIS`|LEGENDNAME", in_context: "(^|[[:space:]]|\\()", # TODO: Allow any punctuation before replace: "" ) + # step 3c : fill in atom fields tag_contents@( tag: "", - contents: { if card_name=="" then "CARDNAME" else card_name } + contents: { "" + (if card_name=="" then "CARDNAME" else card_name) + "" } ) + tag_contents@( tag: "", - contents: { if card_name=="" then "LEGENDNAME" else legend_filter(card_name) } + contents: { "" + (if card_name=="" then "LEGENDNAME" else legend_filter(card_name)) + "" } ) + # step 4 : explict non mana symbols replace@( @@ -439,7 +439,7 @@ text_filter := replace: { _1 + to_upper(_2) }) + curly_quotes + # step 9 : spellcheck - { if set.mark_errors then + { if set.mark_errors then check_spelling( language: language().spellcheck_code, extra_dictionary: "/magic.mse-game/magic-words", diff --git a/src/script/functions/spelling.cpp b/src/script/functions/spelling.cpp index 733979c7..0e2babc7 100644 --- a/src/script/functions/spelling.cpp +++ b/src/script/functions/spelling.cpp @@ -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)); if (word.empty()) return true; // symbol? - if (in_tag(input,_(" tags should prevent spellcheck return true; } // run through spellchecker(s)