The check_spelling function now has support for additional dictionaries and regexes to match.

The magic game uses these features.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1269 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-12-30 02:09:11 +00:00
parent 09216eca5d
commit 12f8be203e
11 changed files with 185 additions and 18 deletions
+34
View File
@@ -0,0 +1,34 @@
33
mana
untap/MSDRJZG
face-down
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
+14 -1
View File
@@ -334,8 +334,17 @@ mana_context :=
| <param-cost>[ ]*<match></param-cost> # keyword argument that is declared as cost
| <param-cost><match>, # keyword argument that is declared as cost
";
# truncates the name of legends
legend_filter := replace@(match:"(, | of | the ).*", replace: "" )
# these are considered a correct 'word' for spellchecking in the text box:
additional_text_words := match@(match:
"(?ix)^(?: # match whole word
<atom-[^>]*>.*?</atom-[^>]*> # cardnames and stuff
| [+-]?[0-9X]+ / [+-]?[0-9X]+ # '3/3', '+X/+X'
)$")
# the rule text filter
# - adds mana symbols
# - makes text in parentheses italic
@@ -413,7 +422,11 @@ text_filter :=
replace: { _1 + to_upper(_2) }) +
curly_quotes +
# step 9 : spellcheck
{ check_spelling(language:language().spellcheck_code) }
{ check_spelling(
language: language().spellcheck_code,
extra_dictionary: "/magic.mse-game/magic-words",
extra_match: additional_text_words
)}
############################################################## Other boxes