diff options
author | László Németh <nemeth@numbertext.org> | 2012-08-24 13:38:33 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2012-08-24 13:38:33 +0200 |
commit | fb7c76ef5bcbcd1e59f05ab20d745d6f180058b8 (patch) | |
tree | a5a18bcca895bbb507bcae86834df036dcd2de02 | |
parent | 70d8c24a37f6b2ef325d2ba1d69cefff1acfb18c (diff) |
Fix URL handling and URLs of longer explanations
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | pythonpath/lightproof_impl___implname__.py | 4 | ||||
-rw-r--r-- | src/en/en.dat | 18 |
3 files changed, 15 insertions, 11 deletions
@@ -1,3 +1,7 @@ +2012-08-24 László Németh <nemeth@numbertext.org>: + - fix URL splitting + - update URLs in English rules + 2012-08-23 László Németh <nemeth@numbertext.org>: - fix fdo#46542 ("an usability" instead of "a usability") reported by Roman Eisele - fix fdo#46549 (allow "an habitual", too), reported by jacobwwood at fdo diff --git a/pythonpath/lightproof_impl___implname__.py b/pythonpath/lightproof_impl___implname__.py index 8788863..8fd9db5 100644 --- a/pythonpath/lightproof_impl___implname__.py +++ b/pythonpath/lightproof_impl___implname__.py @@ -172,8 +172,8 @@ def proofread( nDocId, TEXT, LOCALE, nStartOfSentencePos, nSuggestedSentenceEndP comment = eval(comment[1:]) else: comment = m.expand(comment) - aErr.aShortComment = comment.replace('|', '\\n').split("\\n")[0].strip() - aErr.aFullComment = comment.replace('|', '\\n').split("\\n")[-1].strip() + aErr.aShortComment = comment.replace('|', '\n').replace('\\n', '\n').split("\n")[0].strip() + aErr.aFullComment = comment.replace('|', '\n').replace('\\n', '\n').split("\n")[-1].strip() if "://" in aErr.aFullComment: p = PropertyValue() p.Name = "FullCommentURL" diff --git a/src/en/en.dat b/src/en/en.dat index 3a6cd03..95b0d68 100644 --- a/src/en/en.dat +++ b/src/en/en.dat @@ -56,33 +56,33 @@ etc [-–'’\w]* # rules ("aA", "aAN", "aB" sets are defined at the end of the file) -{a}n{_}{vow}{etc} <- {vow} in aA or {vow}.lower() in aA -> {a}{_}{vow}{etc} # Did you mean: \n http://en.wikipedia.org/wiki/English_articles#Discrimination_between_a_and_an +{a}n{_}{vow}{etc} <- {vow} in aA or {vow}.lower() in aA -> {a}{_}{vow}{etc} # Did you mean: \n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an a{_}{vow}{etc} <- ({vow} <> {vow}.upper()) and not ({vow} in aA or - {vow}.lower() in aA) and spell({vow}) -> an{_}{vow}{etc} # Bad article? \n http://en.wikipedia.org/wiki/English_articles#Discrimination_between_a_and_an + {vow}.lower() in aA) and spell({vow}) -> an{_}{vow}{etc} # Bad article? \n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an -a{_}{con}{etc} <- {con} in aAN or {con}.lower() in aAN -> an{_}{con}{etc} # Did you mean: \n http://en.wikipedia.org/wiki/English_articles#Discrimination_between_a_and_an +a{_}{con}{etc} <- {con} in aAN or {con}.lower() in aAN -> an{_}{con}{etc} # Did you mean: \n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an {a}n{_}{con}{etc} <- ({con} <> {con}.upper()) and not ({con} in aA or - {con}.lower() in aAN) and not {con} in aB and spell({con}) -> {a}{_}{con}{etc} # Bad article? \n http://en.wikipedia.org/wiki/English_articles#Discrimination_between_a_and_an + {con}.lower() in aAN) and not {con} in aB and spell({con}) -> {a}{_}{con}{etc} # Bad article? \n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an # rules for sentences beginning with "A" ^A{_}{vow}{etc} <- ({vow} <> {vow}.upper()) and not ({vow} in aA or - {vow}.lower() in aA) and spell({vow}) -> An{_}{vow}{etc} # Bad article? \n http://en.wikipedia.org/wiki/English_articles#Discrimination_between_a_and_an + {vow}.lower() in aA) and spell({vow}) -> An{_}{vow}{etc} # Bad article? \n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an -^A{_}{con}{etc} <- {con} in aAN or {con}.lower() in aAN -> An{_}{con}{etc} # Did you mean: \n http://en.wikipedia.org/wiki/English_articles#Discrimination_between_a_and_an +^A{_}{con}{etc} <- {con} in aAN or {con}.lower() in aAN -> An{_}{con}{etc} # Did you mean: \n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an # check numbers nvow (8[0-9]*|1[18](000)*)(th)? # 8, 8th, 11, 11th, 18, 18th, 11000, 11000th... -a{_}{nvow}{etc} -> an{_}{nvow}{etc} # Did you mean: \n http://en.wikipedia.org/wiki/English_articles#Discrimination_between_a_and_an -^A{_}{nvow}{etc} -> An{_}{nvow}{etc} # Did you mean: \n http://en.wikipedia.org/wiki/English_articles#Discrimination_between_a_and_an +a{_}{nvow}{etc} -> an{_}{nvow}{etc} # Did you mean: \n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an +^A{_}{nvow}{etc} -> An{_}{nvow}{etc} # Did you mean: \n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an ncon [0-79][0-9]* -{a}n{_}{ncon}{etc} <- not {ncon}[:2] in ["11", "18"] -> {a}{_}{ncon}{etc} # Did you mean: \n http://en.wikipedia.org/wiki/English_articles#Discrimination_between_a_and_an +{a}n{_}{ncon}{etc} <- not {ncon}[:2] in ["11", "18"] -> {a}{_}{ncon}{etc} # Did you mean: \n http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an # paragraph capitalization |