summaryrefslogtreecommitdiff
path: root/en
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2012-11-30 17:29:41 +0100
committerLászló Németh <nemeth@numbertext.org>2012-11-30 17:29:41 +0100
commit8be323a6b7496003419e2587bc4573949fe142dc (patch)
treedea1ed3f0f1c2e03cfb2161d8072d799b91e0425 /en
parentafc12cc53bf96f765b4513868d3b7530c66711f1 (diff)
Python 3 port of Lightproof en/hu modules
Diffstat (limited to 'en')
-rw-r--r--en/pythonpath/lightproof_en.py2
-rw-r--r--en/pythonpath/lightproof_impl_en.py5
2 files changed, 3 insertions, 4 deletions
diff --git a/en/pythonpath/lightproof_en.py b/en/pythonpath/lightproof_en.py
index 3108489..05fca1d 100644
--- a/en/pythonpath/lightproof_en.py
+++ b/en/pythonpath/lightproof_en.py
@@ -1,3 +1,3 @@
# -*- encoding: UTF-8 -*-
-dic = [[u'(?u)(?<![-\\w\u2013.,\xad])and and(?![-\\w\u2013\xad])', u'and', u'Did you mean:', False, 0], [u'(?u)(?<![-\\w\u2013.,\xad])or or(?![-\\w\u2013\xad])', u'or', u'Did you mean:', False, 0], [u'(?u)(?<![-\\w\u2013.,\xad])for for(?![-\\w\u2013\xad])', u'for', u'Did you mean:', False, 0], [u'(?u)(?<![-\\w\u2013.,\xad])the the(?![-\\w\u2013\xad])', u'the', u'Did you mean:', False, 0], [u'(?iu)(?<![-\\w\u2013.,\xad])[Yy][Ii][Nn][Gg] [Aa][Nn][Dd] [Yy][Aa][Nn][Gg](?![-\\w\u2013\xad])', u'yin and yang', u'Did you mean:', False, 0], [u'(?iu)(?<![-\\w\u2013.,\xad])[Ss][Cc][Oo][Tt] [Ff][Rr][Ee][Ee](?![-\\w\u2013\xad])', u'scot-free\\nscotfree', u'Did you mean:', False, 0], [u"(?iu)(?<![-\\w\u2013.,\xad])([Yy][Oo][Uu][Rr]|[Hh][Ee][Rr]|[Oo][Uu][Rr]|[Tt][Hh][Ee][Ii][Rr])['\u2019][Ss](?![-\\w\u2013\xad])", u'\\1s', u'Possessive pronoun: \\n http://en.wikipedia.org/wiki/Possessive_pronoun', False, 0], [u'(?u)(?<![-\\w\u2013.,\xad])(?P<a_1>[Aa])n(?P<_>[ ][\'\u2018"\u201c]?)(?P<vow_1>[aeiouAEIOU]\\w*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'\\g<a_1>\\g<_>\\g<vow_1>\\g<etc_1>', u'Did you mean: \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'm.group("vow_1") in aA or m.group("vow_1").lower() in aA', 0], [u'(?u)(?<![-\\w\u2013.,\xad])a(?P<_>[ ][\'\u2018"\u201c]?)(?P<vow_1>[aeiouAEIOU]\\w*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'an\\g<_>\\g<vow_1>\\g<etc_1>', u'Bad article? \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'(m.group("vow_1") <> m.group("vow_1").upper()) and not (m.group("vow_1") in aA or m.group("vow_1").lower() in aA) and spell(LOCALE,m.group("vow_1"))', 0], [u'(?u)(?<![-\\w\u2013.,\xad])a(?P<_>[ ][\'\u2018"\u201c]?)(?P<con_1>[bcdfghj-np-tv-zBCDFGHJ-NP-TV-Z]\\w*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'an\\g<_>\\g<con_1>\\g<etc_1>', u'Did you mean: \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'm.group("con_1") in aAN or m.group("con_1").lower() in aAN', 0], [u'(?u)(?<![-\\w\u2013.,\xad])(?P<a_1>[Aa])n(?P<_>[ ][\'\u2018"\u201c]?)(?P<con_1>[bcdfghj-np-tv-zBCDFGHJ-NP-TV-Z]\\w*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'\\g<a_1>\\g<_>\\g<con_1>\\g<etc_1>', u'Bad article? \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'(m.group("con_1") <> m.group("con_1").upper()) and not (m.group("con_1") in aA or m.group("con_1").lower() in aAN) and not m.group("con_1") in aB and spell(LOCALE,m.group("con_1"))', 0], [u'(?u)((?<=[!?.] )|^)A(?P<_>[ ][\'\u2018"\u201c]?)(?P<vow_1>[aeiouAEIOU]\\w*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'An\\g<_>\\g<vow_1>\\g<etc_1>', u'Bad article? \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'(m.group("vow_1") <> m.group("vow_1").upper()) and not (m.group("vow_1") in aA or m.group("vow_1").lower() in aA) and spell(LOCALE,m.group("vow_1"))', 0], [u'(?u)((?<=[!?.] )|^)A(?P<_>[ ][\'\u2018"\u201c]?)(?P<con_1>[bcdfghj-np-tv-zBCDFGHJ-NP-TV-Z]\\w*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'An\\g<_>\\g<con_1>\\g<etc_1>', u'Did you mean: \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'm.group("con_1") in aAN or m.group("con_1").lower() in aAN', 0], [u'(?u)(?<![-\\w\u2013.,\xad])a(?P<_>[ ][\'\u2018"\u201c]?)(?P<nvow_1>(8[0-9]*|1[18](000)*)(th)?)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'an\\g<_>\\g<nvow_1>\\g<etc_1>', u'Did you mean: \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', False, 0], [u'(?u)((?<=[!?.] )|^)A(?P<_>[ ][\'\u2018"\u201c]?)(?P<nvow_1>(8[0-9]*|1[18](000)*)(th)?)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'An\\g<_>\\g<nvow_1>\\g<etc_1>', u'Did you mean: \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', False, 0], [u'(?u)(?<![-\\w\u2013.,\xad])(?P<a_1>[Aa])n(?P<_>[ ][\'\u2018"\u201c]?)(?P<ncon_1>[0-79][0-9]*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'\\g<a_1>\\g<_>\\g<ncon_1>\\g<etc_1>', u'Did you mean: \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'not m.group("ncon_1")[:2] in ["11", "18"]', 0], [u'(?u)(?<![-\\w\u2013.,\xad])(^)(?P<low_1>[a-z]+)(?![-\\w\u2013\xad])', u'= m.group("low_1").capitalize()', u'Missing capitalization?', u'paralcap.search(TEXT) and not abbrev.search(TEXT)', 0], [u'(?u)((?<=[!?.] )|^)(?P<low_1>[a-z]+)(?![-\\w\u2013\xad])', u'= m.group("low_1").capitalize()', u'Missing capitalization?', u'option(LOCALE,"cap") and not abbrev.search(TEXT)', 0], [u'(?u) ([.?!,:;)\u201d\\]])\\b', u'\\1 ', u'Reversed space and punctuation?', False, 0], [u'(?u) +[.]', u'.', u'Extra space before the period?', u'LOCALE.Country == "US"', 0], [u'(?u) +[.]', u'.', u'Extra space before the full stop?', u'LOCALE.Country != "US"', 0], [u'(?u) +([?!,:;)\u201d\\]])', u'\\1', u'= "Extra space before the " + punct[m.group(1)] + "?"', False, 0], [u'(?u)([([\u201c]) ', u'\\1', u'= "Extra space after the " + punct[m.group(1)] + "?"', False, 0], [u'(?u)\\b(---?| --? )\\b', u' \u2013 \\n\u2014', u'En dash or em dash:', u'not option(LOCALE,"ndash") and not option(LOCALE,"mdash")', 0], [u'(?u)\\b(---?| --? |\u2014)\\b', u' \u2013 ', u'En dash:', u'option(LOCALE,"ndash") and not option(LOCALE,"mdash")', 0], [u'(?u)\\b(---?| --? | \u2013 )\\b', u'\u2014', u'Em dash:', u'option(LOCALE,"mdash")', 0], [u'(?u)(?P<number_1>\\d+([.]\\d+)?)(x| x )(?P<number_2>\\d+([.]\\d+)?)', u'\\g<number_1>\xd7\\g<number_2>', u'Multiplication sign. \\n http://en.wikipedia.org/wiki/Multiplication_sign', u'option(LOCALE,"times")', 0], [u'(?u)(?P<Abc_1>[a-zA-Z]+)(?P<pun_1>[?!,:;%\u2030\u2031\u02da\u201c\u201d\u2018])(?P<Abc_2>[a-zA-Z]+)', u'\\g<Abc_1>\\g<pun_1> \\g<Abc_2>', u'Missing space?', False, 0], [u'(?u)(?P<abc_1>[a-z]+)[.](?P<ABC_1>[A-Z]+)', u'\\g<abc_1>. \\g<ABC_1>', u'Missing space?', False, 0], [u'(?u)[)]', u'', u'Extra closing parenthesis?', u'option(LOCALE,"pair") and not "(" in TEXT', 0], [u'(?u)[(]', u'', u'Extra opening parenthesis?', u'option(LOCALE,"pair") and TEXT[-1] in u"?!;:\u201d\u2019" and not ")" in TEXT', 0], [u'(?u)(?<![0-9])\u201d', u'', u'Extra quotation mark?', u'option(LOCALE,"pair") and not u"\u201c" in TEXT', 0], [u'(?u)(?<=[0-9])\u201d', u'\u2033\\n', u'Bad double prime or extra quotation mark?', u'option(LOCALE,"apostrophe") and not u"\u201c" in TEXT', 0], [u'(?u)\u201c', u'', u'Extra quotation mark?', u'option(LOCALE,"pair") and TEXT[-1] in u"?!;:\u201d\u2019" and not u"\u201d" in TEXT', 0], [u'(?u)[.]{3}', u'\u2026', u'Ellipsis.', u'option(LOCALE,"ellipsis")', 0], [u'(?u)\\b {2,3}(\\b|$)', u'\\1 ', u'Extra space.', u'option(LOCALE,"spaces")', 0], [u'(?u)(^|\\b|(?P<pun_1>[?!,:;%\u2030\u2031\u02da\u201c\u201d\u2018])|[.]) {2,3}(\\b|$)', u'\\1 ', u'Extra space.', u'option(LOCALE,"spaces2")', 0], [u'(?u)(^|\\b|(?P<pun_1>[?!,:;%\u2030\u2031\u02da\u201c\u201d\u2018])|[.]) {4,}(\\b|$)', u'\\1 \\n\t', u'Change multiple spaces to a single space or a tabulator:', u'option(LOCALE,"spaces3")', 0], [u'(?iu)[\\"\u201c\u201d\u201f\u201e]((?P<abc_1>[a-zA-Z]+)[^\\"\u201c\u201d\u201f\u201e]*)[\\"\u201c\u201f]', u'\u201c\\1\u201d', u'Quotation marks.', u'option(LOCALE,"quotation")', 0], [u'(?iu)[\\"\u201d\u201f\u201e]((?P<abc_1>[a-zA-Z]+)[^\\"\u201c\u201d\u201f\u201e]*)[\\"\u201c\u201d\u201f]', u'\u201c\\1\u201d', u'Quotation marks.', u'option(LOCALE,"quotation")', 0], [u"(?iu)'(?P<abc_1>[a-zA-Z]+)'", u'\u2018\\g<abc_1>\u2019', u'Quotation marks.', u'option(LOCALE,"apostrophe")', 0], [u'(?iu)[\\"\u201d\u201f\u201e]((?P<abc_1>[a-zA-Z]+)[^\\"\u201c\u201d\u201f\u201e]*)[\\"\u201c\u201d\u201f]', u'\u201c\\1\u201d', u'Quotation marks.', u'option(LOCALE,"apostrophe")', 0], [u"(?iu)(?P<Abc_1>[a-zA-ZA-Z]+)'(?P<w_1>\\w*)", u'\\g<Abc_1>\u2019\\g<w_1>', u'Replace typewriter apostrophe or quotation mark:', u'option(LOCALE,"apostrophe")', 0], [u"(?u)(?<= )'(?P<Abc_1>[a-zA-Z]+)", u'\u2018\\g<Abc_1>\\n\u2019\\g<Abc_1>', u'Replace typewriter quotation mark or apostrophe:', u'option(LOCALE,"apostrophe")', 0], [u"(?u)^'(?P<Abc_1>[a-zA-Z]+)", u'\u2018\\g<Abc_1>\\n\u2019\\g<Abc_1>', u'Replace typewriter quotation mark or apostrophe:', u'option(LOCALE,"apostrophe")', 0], [u'(?u)\\b(?P<d2_1>\\d\\d)(?P<d_1>\\d\\d\\d)\\b', u'\\g<d2_1>,\\g<d_1>\\n\\g<d2_1>\u202f\\g<d_1>', u'Use thousand separator (common or ISO).', u'option(LOCALE,"numsep")', 0], [u'(?u)\\b(?P<D_1>\\d{1,3})(?P<d_1>\\d\\d\\d)(?P<d_2>\\d\\d\\d)\\b', u'\\g<D_1>,\\g<d_1>,\\g<d_2>\\n\\g<D_1>\u202f\\g<d_1>\u202f\\g<d_2>', u'Use thousand separators (common or ISO).', u'option(LOCALE,"numsep")', 0], [u'(?u)\\b(?P<D_1>\\d{1,3})(?P<d_1>\\d\\d\\d)(?P<d_2>\\d\\d\\d)(?P<d_3>\\d\\d\\d)\\b', u'\\g<D_1>,\\g<d_1>,\\g<d_2>,\\g<d_3>\\n\\g<D_1>\u202f\\g<d_1>\u202f\\g<d_2>\u202f\\g<d_3>', u'Use thousand separators (common or ISO).', u'option(LOCALE,"numsep")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])(?P<Abc_1>[a-zA-Z]+) \\1(?![-\\w\u2013\xad])', u'\\g<Abc_1>', u'Word duplication?', u'option(LOCALE,"dup")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([Tt])his (?P<abc_1>[a-z]+)(?![-\\w\u2013\xad])', u'\\1hese \\g<abc_1>\\n\\1his, \\g<abc_1>', u'Did you mean:', u'option(LOCALE,"grammar") and morph(LOCALE,m.group("abc_1"), "Ns")', 0], [u"(?u)(?<![-\\w\u2013.,\xad])with it['\u2019]s(?![-\\w\u2013\xad])", u'with its\\nwith, it\u2019s', u'Did you mean:', u'option(LOCALE,"grammar")', 0], [u"(?iu)(?<![-\\w\u2013.,\xad])([Ii][Tt]|[Ss]?[Hh][Ee]) [Dd][Oo][Nn]['\u2019][Tt](?![-\\w\u2013\xad])", u'\\1 doesn\u2019t', u'Did you mean:', u'option(LOCALE,"grammar")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) (\xb0F|Fahrenheit)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "F", "C", u" \xb0C", ".", ",")', u'Convert to Celsius:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) (\xb0C|Celsius)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "C", "F", u" \xb0F", ".", ",")', u'Convert to Fahrenheit:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*(?: 1/2| ?\xbd)?) (ft|foot|feet)(?! [1-9])(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "ft", "cm", " cm", ".", ",") + "\\n" + measurement(m.group(1), "ft", "m", " m", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*(?: 1/2| ?\xbd)?) ft[.]? ([0-9]+(?: 1/2| ?\xbd)?) in(?![-\\w\u2013\xad])', u'= measurement(m.group(1) + "*12+" + m.group(2), "in", "cm", " cm", ".", ",") + "\\n" + measurement(m.group(1) + "*12+" + m.group(2), "in", "m", " m", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*(?: 1/2| ?\xbd)?) in(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "in", "mm", " mm", ".", ",") + "\\n" + measurement(m.group(1), "in", "cm", " cm", ".", ",") + "\\n" + measurement(m.group(1), "in", "m", " m", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) mm(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "mm", "in", " in", ".", ",")', u'Convert from metric:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) cm(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "cm", "in", " in", ".", ",") + "\\n" + measurement(m.group(1), "cm", "ft", " ft", ".", ",")', u'Convert from metric:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) (m|meter|metre)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "m", "in", " in", ".", ",") + "\\n" + measurement(m.group(1), "m", "ft", " ft", ".", ",") + "\\n" + measurement(m.group(1), "m", "mi", " mi", ".", ",")', u'Convert from metric:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*(?: 1/2| ?\xbd)?) miles?(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "mi", "m", " m", ".", ",") + "\\n" + measurement(m.group(1), "mi", "km", " km", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) km(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "km", "mi", " mi", ".", ",")', u'Convert to miles:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:,\\d+)?) (yd|yards?)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "yd", "m", " m", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:,\\d+)?) (gal(lons?)?)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "gal", "l", " l", ".", ",") + "\\n" + measurement(m.group(1), "uk_gal", "l", " l (in UK)", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:,\\d+)?) (pint)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "pt", "dl", " dl", ".", ",") + "\\n" + measurement(m.group(1), "uk_pt", "dl", " dl (in UK)", ".", ",") + "\\n" + measurement(m.group(1), "pt", "l", " l", ".", ",") + "\\n" + measurement(m.group(1), "uk_pt", "l", " l (in UK)", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:,\\d+)?) (l|L|litres?|liters?)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "l", "gal", " gal", ".", ",") + "\\n" + measurement(m.group(1), "l", "gal", " gal (in UK)", ".", ",")', u'Convert to gallons:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) lbs?[.]?(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "lbm", "kg", " kg", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) kg[.]?(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "kg", "lbm", " lb", ".", ",")', u'Convert to pounds:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) mph(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "mph", "km/h", " km/h", ".", ",")', u'Convert to km/hour:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) km/h(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "km/h", "mph", " mph", ".", ",")', u'Convert to miles/hour:', u'option(LOCALE,"nonmetric")', 0]]
+dic = [[u'(?u)(?<![-\\w\u2013.,\xad])and and(?![-\\w\u2013\xad])', u'and', u'Did you mean:', False, 0], [u'(?u)(?<![-\\w\u2013.,\xad])or or(?![-\\w\u2013\xad])', u'or', u'Did you mean:', False, 0], [u'(?u)(?<![-\\w\u2013.,\xad])for for(?![-\\w\u2013\xad])', u'for', u'Did you mean:', False, 0], [u'(?u)(?<![-\\w\u2013.,\xad])the the(?![-\\w\u2013\xad])', u'the', u'Did you mean:', False, 0], [u'(?iu)(?<![-\\w\u2013.,\xad])[Yy][Ii][Nn][Gg] [Aa][Nn][Dd] [Yy][Aa][Nn][Gg](?![-\\w\u2013\xad])', u'yin and yang', u'Did you mean:', False, 0], [u'(?iu)(?<![-\\w\u2013.,\xad])[Ss][Cc][Oo][Tt] [Ff][Rr][Ee][Ee](?![-\\w\u2013\xad])', u'scot-free\\nscotfree', u'Did you mean:', False, 0], [u"(?iu)(?<![-\\w\u2013.,\xad])([Yy][Oo][Uu][Rr]|[Hh][Ee][Rr]|[Oo][Uu][Rr]|[Tt][Hh][Ee][Ii][Rr])['\u2019][Ss](?![-\\w\u2013\xad])", u'\\1s', u'Possessive pronoun: \\n http://en.wikipedia.org/wiki/Possessive_pronoun', False, 0], [u'(?u)(?<![-\\w\u2013.,\xad])(?P<a_1>[Aa])n(?P<_>[ ][\'\u2018"\u201c]?)(?P<vow_1>[aeiouAEIOU]\\w*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'\\g<a_1>\\g<_>\\g<vow_1>\\g<etc_1>', u'Did you mean: \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'm.group("vow_1") in aA or m.group("vow_1").lower() in aA', 0], [u'(?u)(?<![-\\w\u2013.,\xad])a(?P<_>[ ][\'\u2018"\u201c]?)(?P<vow_1>[aeiouAEIOU]\\w*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'an\\g<_>\\g<vow_1>\\g<etc_1>', u'Bad article? \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'(m.group("vow_1") != m.group("vow_1").upper()) and not (m.group("vow_1") in aA or m.group("vow_1").lower() in aA) and spell(LOCALE,m.group("vow_1"))', 0], [u'(?u)(?<![-\\w\u2013.,\xad])a(?P<_>[ ][\'\u2018"\u201c]?)(?P<con_1>[bcdfghj-np-tv-zBCDFGHJ-NP-TV-Z]\\w*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'an\\g<_>\\g<con_1>\\g<etc_1>', u'Did you mean: \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'm.group("con_1") in aAN or m.group("con_1").lower() in aAN', 0], [u'(?u)(?<![-\\w\u2013.,\xad])(?P<a_1>[Aa])n(?P<_>[ ][\'\u2018"\u201c]?)(?P<con_1>[bcdfghj-np-tv-zBCDFGHJ-NP-TV-Z]\\w*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'\\g<a_1>\\g<_>\\g<con_1>\\g<etc_1>', u'Bad article? \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'(m.group("con_1") != m.group("con_1").upper()) and not (m.group("con_1") in aA or m.group("con_1").lower() in aAN) and not m.group("con_1") in aB and spell(LOCALE,m.group("con_1"))', 0], [u'(?u)((?<=[!?.] )|^)A(?P<_>[ ][\'\u2018"\u201c]?)(?P<vow_1>[aeiouAEIOU]\\w*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'An\\g<_>\\g<vow_1>\\g<etc_1>', u'Bad article? \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'(m.group("vow_1") != m.group("vow_1").upper()) and not (m.group("vow_1") in aA or m.group("vow_1").lower() in aA) and spell(LOCALE,m.group("vow_1"))', 0], [u'(?u)((?<=[!?.] )|^)A(?P<_>[ ][\'\u2018"\u201c]?)(?P<con_1>[bcdfghj-np-tv-zBCDFGHJ-NP-TV-Z]\\w*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'An\\g<_>\\g<con_1>\\g<etc_1>', u'Did you mean: \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'm.group("con_1") in aAN or m.group("con_1").lower() in aAN', 0], [u'(?u)(?<![-\\w\u2013.,\xad])a(?P<_>[ ][\'\u2018"\u201c]?)(?P<nvow_1>(8[0-9]*|1[18](000)*)(th)?)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'an\\g<_>\\g<nvow_1>\\g<etc_1>', u'Did you mean: \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', False, 0], [u'(?u)((?<=[!?.] )|^)A(?P<_>[ ][\'\u2018"\u201c]?)(?P<nvow_1>(8[0-9]*|1[18](000)*)(th)?)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'An\\g<_>\\g<nvow_1>\\g<etc_1>', u'Did you mean: \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', False, 0], [u'(?u)(?<![-\\w\u2013.,\xad])(?P<a_1>[Aa])n(?P<_>[ ][\'\u2018"\u201c]?)(?P<ncon_1>[0-79][0-9]*)(?P<etc_1>[-\u2013\'\u2019\\w]*)(?![-\\w\u2013\xad])', u'\\g<a_1>\\g<_>\\g<ncon_1>\\g<etc_1>', u'Did you mean: \\n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an', u'not m.group("ncon_1")[:2] in ["11", "18"]', 0], [u'(?u)(?<![-\\w\u2013.,\xad])(^)(?P<low_1>[a-z]+)(?![-\\w\u2013\xad])', u'= m.group("low_1").capitalize()', u'Missing capitalization?', u'paralcap.search(TEXT) and not abbrev.search(TEXT)', 0], [u'(?u)((?<=[!?.] )|^)(?P<low_1>[a-z]+)(?![-\\w\u2013\xad])', u'= m.group("low_1").capitalize()', u'Missing capitalization?', u'option(LOCALE,"cap") and not abbrev.search(TEXT)', 0], [u'(?u) ([.?!,:;)\u201d\\]])\\b', u'\\1 ', u'Reversed space and punctuation?', False, 0], [u'(?u) +[.]', u'.', u'Extra space before the period?', u'LOCALE.Country == "US"', 0], [u'(?u) +[.]', u'.', u'Extra space before the full stop?', u'LOCALE.Country != "US"', 0], [u'(?u) +([?!,:;)\u201d\\]])', u'\\1', u'= "Extra space before the " + punct[m.group(1)] + "?"', False, 0], [u'(?u)([([\u201c]) ', u'\\1', u'= "Extra space after the " + punct[m.group(1)] + "?"', False, 0], [u'(?u)\\b(---?| --? )\\b', u' \u2013 \\n\u2014', u'En dash or em dash:', u'not option(LOCALE,"ndash") and not option(LOCALE,"mdash")', 0], [u'(?u)\\b(---?| --? |\u2014)\\b', u' \u2013 ', u'En dash:', u'option(LOCALE,"ndash") and not option(LOCALE,"mdash")', 0], [u'(?u)\\b(---?| --? | \u2013 )\\b', u'\u2014', u'Em dash:', u'option(LOCALE,"mdash")', 0], [u'(?u)(?P<number_1>\\d+([.]\\d+)?)(x| x )(?P<number_2>\\d+([.]\\d+)?)', u'\\g<number_1>\xd7\\g<number_2>', u'Multiplication sign. \\n http://en.wikipedia.org/wiki/Multiplication_sign', u'option(LOCALE,"times")', 0], [u'(?u)(?P<Abc_1>[a-zA-Z]+)(?P<pun_1>[?!,:;%\u2030\u2031\u02da\u201c\u201d\u2018])(?P<Abc_2>[a-zA-Z]+)', u'\\g<Abc_1>\\g<pun_1> \\g<Abc_2>', u'Missing space?', False, 0], [u'(?u)(?P<abc_1>[a-z]+)[.](?P<ABC_1>[A-Z]+)', u'\\g<abc_1>. \\g<ABC_1>', u'Missing space?', False, 0], [u'(?u)[)]', u'', u'Extra closing parenthesis?', u'option(LOCALE,"pair") and not "(" in TEXT', 0], [u'(?u)[(]', u'', u'Extra opening parenthesis?', u'option(LOCALE,"pair") and TEXT[-1] in u"?!;:\u201d\u2019" and not ")" in TEXT', 0], [u'(?u)(?<![0-9])\u201d', u'', u'Extra quotation mark?', u'option(LOCALE,"pair") and not u"\u201c" in TEXT', 0], [u'(?u)(?<=[0-9])\u201d', u'\u2033\\n', u'Bad double prime or extra quotation mark?', u'option(LOCALE,"apostrophe") and not u"\u201c" in TEXT', 0], [u'(?u)\u201c', u'', u'Extra quotation mark?', u'option(LOCALE,"pair") and TEXT[-1] in u"?!;:\u201d\u2019" and not u"\u201d" in TEXT', 0], [u'(?u)[.]{3}', u'\u2026', u'Ellipsis.', u'option(LOCALE,"ellipsis")', 0], [u'(?u)\\b {2,3}(\\b|$)', u'\\1 ', u'Extra space.', u'option(LOCALE,"spaces")', 0], [u'(?u)(^|\\b|(?P<pun_1>[?!,:;%\u2030\u2031\u02da\u201c\u201d\u2018])|[.]) {2,3}(\\b|$)', u'\\1 ', u'Extra space.', u'option(LOCALE,"spaces2")', 0], [u'(?u)(^|\\b|(?P<pun_1>[?!,:;%\u2030\u2031\u02da\u201c\u201d\u2018])|[.]) {4,}(\\b|$)', u'\\1 \\n\t', u'Change multiple spaces to a single space or a tabulator:', u'option(LOCALE,"spaces3")', 0], [u'(?iu)[\\"\u201c\u201d\u201f\u201e]((?P<abc_1>[a-zA-Z]+)[^\\"\u201c\u201d\u201f\u201e]*)[\\"\u201c\u201f]', u'\u201c\\1\u201d', u'Quotation marks.', u'option(LOCALE,"quotation")', 0], [u'(?iu)[\\"\u201d\u201f\u201e]((?P<abc_1>[a-zA-Z]+)[^\\"\u201c\u201d\u201f\u201e]*)[\\"\u201c\u201d\u201f]', u'\u201c\\1\u201d', u'Quotation marks.', u'option(LOCALE,"quotation")', 0], [u"(?iu)'(?P<abc_1>[a-zA-Z]+)'", u'\u2018\\g<abc_1>\u2019', u'Quotation marks.', u'option(LOCALE,"apostrophe")', 0], [u'(?iu)[\\"\u201d\u201f\u201e]((?P<abc_1>[a-zA-Z]+)[^\\"\u201c\u201d\u201f\u201e]*)[\\"\u201c\u201d\u201f]', u'\u201c\\1\u201d', u'Quotation marks.', u'option(LOCALE,"apostrophe")', 0], [u"(?iu)(?P<Abc_1>[a-zA-ZA-Z]+)'(?P<w_1>\\w*)", u'\\g<Abc_1>\u2019\\g<w_1>', u'Replace typewriter apostrophe or quotation mark:', u'option(LOCALE,"apostrophe")', 0], [u"(?u)(?<= )'(?P<Abc_1>[a-zA-Z]+)", u'\u2018\\g<Abc_1>\\n\u2019\\g<Abc_1>', u'Replace typewriter quotation mark or apostrophe:', u'option(LOCALE,"apostrophe")', 0], [u"(?u)^'(?P<Abc_1>[a-zA-Z]+)", u'\u2018\\g<Abc_1>\\n\u2019\\g<Abc_1>', u'Replace typewriter quotation mark or apostrophe:', u'option(LOCALE,"apostrophe")', 0], [u'(?u)\\b(?P<d2_1>\\d\\d)(?P<d_1>\\d\\d\\d)\\b', u'\\g<d2_1>,\\g<d_1>\\n\\g<d2_1>\u202f\\g<d_1>', u'Use thousand separator (common or ISO).', u'option(LOCALE,"numsep")', 0], [u'(?u)\\b(?P<D_1>\\d{1,3})(?P<d_1>\\d\\d\\d)(?P<d_2>\\d\\d\\d)\\b', u'\\g<D_1>,\\g<d_1>,\\g<d_2>\\n\\g<D_1>\u202f\\g<d_1>\u202f\\g<d_2>', u'Use thousand separators (common or ISO).', u'option(LOCALE,"numsep")', 0], [u'(?u)\\b(?P<D_1>\\d{1,3})(?P<d_1>\\d\\d\\d)(?P<d_2>\\d\\d\\d)(?P<d_3>\\d\\d\\d)\\b', u'\\g<D_1>,\\g<d_1>,\\g<d_2>,\\g<d_3>\\n\\g<D_1>\u202f\\g<d_1>\u202f\\g<d_2>\u202f\\g<d_3>', u'Use thousand separators (common or ISO).', u'option(LOCALE,"numsep")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])(?P<Abc_1>[a-zA-Z]+) \\1(?![-\\w\u2013\xad])', u'\\g<Abc_1>', u'Word duplication?', u'option(LOCALE,"dup")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([Tt])his (?P<abc_1>[a-z]+)(?![-\\w\u2013\xad])', u'\\1hese \\g<abc_1>\\n\\1his, \\g<abc_1>', u'Did you mean:', u'option(LOCALE,"grammar") and morph(LOCALE,m.group("abc_1"), "Ns")', 0], [u"(?u)(?<![-\\w\u2013.,\xad])with it['\u2019]s(?![-\\w\u2013\xad])", u'with its\\nwith, it\u2019s', u'Did you mean:', u'option(LOCALE,"grammar")', 0], [u"(?iu)(?<![-\\w\u2013.,\xad])([Ii][Tt]|[Ss]?[Hh][Ee]) [Dd][Oo][Nn]['\u2019][Tt](?![-\\w\u2013\xad])", u'\\1 doesn\u2019t', u'Did you mean:', u'option(LOCALE,"grammar")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) (\xb0F|Fahrenheit)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "F", "C", u" \xb0C", ".", ",")', u'Convert to Celsius:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) (\xb0C|Celsius)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "C", "F", u" \xb0F", ".", ",")', u'Convert to Fahrenheit:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*(?: 1/2| ?\xbd)?) (ft|foot|feet)(?! [1-9])(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "ft", "cm", " cm", ".", ",") + "\\n" + measurement(m.group(1), "ft", "m", " m", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*(?: 1/2| ?\xbd)?) ft[.]? ([0-9]+(?: 1/2| ?\xbd)?) in(?![-\\w\u2013\xad])', u'= measurement(m.group(1) + "*12+" + m.group(2), "in", "cm", " cm", ".", ",") + "\\n" + measurement(m.group(1) + "*12+" + m.group(2), "in", "m", " m", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*(?: 1/2| ?\xbd)?) in(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "in", "mm", " mm", ".", ",") + "\\n" + measurement(m.group(1), "in", "cm", " cm", ".", ",") + "\\n" + measurement(m.group(1), "in", "m", " m", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) mm(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "mm", "in", " in", ".", ",")', u'Convert from metric:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) cm(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "cm", "in", " in", ".", ",") + "\\n" + measurement(m.group(1), "cm", "ft", " ft", ".", ",")', u'Convert from metric:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) (m|meter|metre)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "m", "in", " in", ".", ",") + "\\n" + measurement(m.group(1), "m", "ft", " ft", ".", ",") + "\\n" + measurement(m.group(1), "m", "mi", " mi", ".", ",")', u'Convert from metric:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*(?: 1/2| ?\xbd)?) miles?(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "mi", "m", " m", ".", ",") + "\\n" + measurement(m.group(1), "mi", "km", " km", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) km(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "km", "mi", " mi", ".", ",")', u'Convert to miles:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:,\\d+)?) (yd|yards?)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "yd", "m", " m", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:,\\d+)?) (gal(lons?)?)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "gal", "l", " l", ".", ",") + "\\n" + measurement(m.group(1), "uk_gal", "l", " l (in UK)", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:,\\d+)?) (pint)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "pt", "dl", " dl", ".", ",") + "\\n" + measurement(m.group(1), "uk_pt", "dl", " dl (in UK)", ".", ",") + "\\n" + measurement(m.group(1), "pt", "l", " l", ".", ",") + "\\n" + measurement(m.group(1), "uk_pt", "l", " l (in UK)", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:,\\d+)?) (l|L|litres?|liters?)(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "l", "gal", " gal", ".", ",") + "\\n" + measurement(m.group(1), "l", "gal", " gal (in UK)", ".", ",")', u'Convert to gallons:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) lbs?[.]?(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "lbm", "kg", " kg", ".", ",")', u'Convert to metric:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) kg[.]?(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "kg", "lbm", " lb", ".", ",")', u'Convert to pounds:', u'option(LOCALE,"nonmetric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) mph(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "mph", "km/h", " km/h", ".", ",")', u'Convert to km/hour:', u'option(LOCALE,"metric")', 0], [u'(?u)(?<![-\\w\u2013.,\xad])([-\u2212]?\\d+(?:[,.]\\d+)*) km/h(?![-\\w\u2013\xad])', u'= measurement(m.group(1), "km/h", "mph", " mph", ".", ",")', u'Convert to miles/hour:', u'option(LOCALE,"nonmetric")', 0]]
diff --git a/en/pythonpath/lightproof_impl_en.py b/en/pythonpath/lightproof_impl_en.py
index dd1adb0..2c7072c 100644
--- a/en/pythonpath/lightproof_impl_en.py
+++ b/en/pythonpath/lightproof_impl_en.py
@@ -1,6 +1,5 @@
# -*- encoding: UTF-8 -*-
import uno, re, sys, os, traceback
-from string import join
from com.sun.star.text.TextMarkupType import PROOFREADING
from com.sun.star.beans import PropertyValue
@@ -119,7 +118,7 @@ def suggest(rLoc, word):
if not x:
return word
t = x.getAlternatives()
- suggestions[word] = join(t, "\\n")
+ suggestions[word] = "\\n".join(t)
return suggestions[word]
# get the nth word of the input string or None
@@ -330,7 +329,7 @@ def measurement(mnum, min, mout, mstr, decimal, remove):
m = calc("CONVERT_ADD", (float(eval(mnum.replace(remove, "").replace(decimal, ".").replace(u"\u2212", "-"))), min, mout))
a = list(set([str(calc("ROUND", (m, 0)))[:-2], str(calc("ROUND", (m, 1))), str(calc("ROUND", (m, 2))), str(m)])) # remove duplicated rounded items
a.sort(lambda x, y: len(x) - len(y)) # sort by string length
- return join(a, mstr + "\n").replace(".", decimal).replace("-", u"\u2212") + mstr
+ return (mstr + "\n").join(a).replace(".", decimal).replace("-", u"\u2212") + mstr