Author: esr
Date: Mon Nov 3 05:51:15 2008
New Revision: 30561
URL: http://svn.gna.org/viewcvs/wesnoth?rev=30561&view=rev
Log:
Fix some minor bugs in the spellchecker scanner.
Modified:
trunk/data/tools/wmllint
Modified: trunk/data/tools/wmllint
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmllint?rev=30561&r1=30560&r2=30561&view=diff
==============================================================================
--- trunk/data/tools/wmllint (original)
+++ trunk/data/tools/wmllint Mon Nov 3 05:51:15 2008
@@ -1156,7 +1156,7 @@
for nav in WmlIterator(filename=fn):
# Recognize local spelling exceptions
if not nav.element and "#" in nav.text:
- comment = nav.text[nav.text.index("#")-1:]
+ comment = nav.text[nav.text.index("#"):]
words = re.search("wmllint: local spellings? (.*)", comment)
if words:
for word in words.group(1).split():
@@ -1172,8 +1172,7 @@
value = value[1:].strip()
value = string_strip(value)
value = value.replace("...", " ")
- #value = value.replace("_ ", " ")
- #value = value.replace(" _", " ")
+ value = value.replace("''", "")
value = value.replace("female^", " ")
value = value.replace("male^", " ")
if '<' in value:
@@ -1184,13 +1183,13 @@
for token in value.split():
if d.check(token):
continue
- while token and token[0] in " \t([EMAIL PROTECTED]'":
+ while token and token[0] in " \t([EMAIL PROTECTED]'_":
token = token[1:]
- while token and token[-1] in "-*').,:;?!& \t":
+ while token and token[-1] in "_-*').,:;?!& \t":
token = token[:-1]
+ if token.startswith("%"):
+ continue
if token.startswith("$"):
- continue
- if token.startswith("%"):
continue
if token and token[0].isdigit():
continue
@@ -1209,6 +1208,7 @@
continue
if re.match("[+-][0-9]", token):
continue
+ # Match various onomatopoetic exclamations of variable form
if re.match("hm+", token):
continue
if re.match("a+[ur]*g+h*", token):
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits