Revision: 6862
http://languagetool.svn.sourceforge.net/languagetool/?rev=6862&view=rev
Author: dnaber
Date: 2012-05-10 19:55:36 +0000 (Thu, 10 May 2012)
Log Message:
-----------
although a matter of debate, "an historic", "an historical", and "an habitual"
is not considered incorrect anymore, also see
http://www.merriam-webster.com/dictionary/a%5B2%5D and
https://bugs.freedesktop.org/show_bug.cgi?id=46549
Modified Paths:
--------------
trunk/JLanguageTool/CHANGES.txt
trunk/JLanguageTool/src/java/org/languagetool/rules/en/AvsAnRule.java
trunk/JLanguageTool/src/rules/en/det_a.txt
trunk/JLanguageTool/src/rules/en/det_an.txt
trunk/JLanguageTool/src/test/org/languagetool/rules/en/AvsAnRuleTest.java
Modified: trunk/JLanguageTool/CHANGES.txt
===================================================================
--- trunk/JLanguageTool/CHANGES.txt 2012-05-10 19:52:04 UTC (rev 6861)
+++ trunk/JLanguageTool/CHANGES.txt 2012-05-10 19:55:36 UTC (rev 6862)
@@ -5,6 +5,11 @@
-German:
-many new rules and rule updates
+ -English:
+ -although a matter of debate, "an historic", "an historical", and "an
habitual"
+ is not considered incorrect anymore,
+ also see http://www.merriam-webster.com/dictionary/a%5B2%5D
+
-Catalan:
-major update, including many new rules and new tokenization (Jaume Ortolà
i Font)
Modified: trunk/JLanguageTool/src/java/org/languagetool/rules/en/AvsAnRule.java
===================================================================
--- trunk/JLanguageTool/src/java/org/languagetool/rules/en/AvsAnRule.java
2012-05-10 19:52:04 UTC (rev 6861)
+++ trunk/JLanguageTool/src/java/org/languagetool/rules/en/AvsAnRule.java
2012-05-10 19:55:36 UTC (rev 6862)
@@ -93,10 +93,14 @@
}
if (requiresAn.contains(token.toLowerCase()) ||
requiresAn.contains(token)) {
if (isException) {
- throw new IllegalStateException(token + " is listed in both
det_a.txt and det_an.txt");
+ // some words allow both 'a' and 'an', e.g. 'historical':
+ isException = true;
+ doesRequireA = false;
+ doesRequireAn = false;
+ } else {
+ isException = true;
+ doesRequireAn = true;
}
- isException = true;
- doesRequireAn = true;
}
if (!isException) {
Modified: trunk/JLanguageTool/src/rules/en/det_a.txt
===================================================================
--- trunk/JLanguageTool/src/rules/en/det_a.txt 2012-05-10 19:52:04 UTC (rev
6861)
+++ trunk/JLanguageTool/src/rules/en/det_a.txt 2012-05-10 19:55:36 UTC (rev
6862)
@@ -1,6 +1,7 @@
# words that require 'a' instead of 'an' as a determiner, even
# though they begin with [aeiou] (words are case-insensitive unless the
# line starts with '*').
+# Add words that allow both 'a' and 'an' to det_a.txt and det_an.txt.
# Also see:
http://www.learnenglish.org.uk/grammar/archive/articles_pronunciation.html
Eucharistic
eukaryote
@@ -57,6 +58,9 @@
euthanasia
ewe
ewer
+habitual
+historic
+historical
Ms
one
onetime
Modified: trunk/JLanguageTool/src/rules/en/det_an.txt
===================================================================
--- trunk/JLanguageTool/src/rules/en/det_an.txt 2012-05-10 19:52:04 UTC (rev
6861)
+++ trunk/JLanguageTool/src/rules/en/det_an.txt 2012-05-10 19:55:36 UTC (rev
6862)
@@ -1,6 +1,7 @@
# words that require 'an' instead of 'a' as a determiner, even
# though they don't begin with [aeiou] (words are case-insensitive unless
# the line starts with '*').
+# Add words that allow both 'a' and 'an' to det_a.txt and det_an.txt.
# Also see:
http://www.learnenglish.org.uk/grammar/archive/articles_pronunciation.html
α
8
@@ -36,12 +37,15 @@
S
R
h-bomb
+habitual
hauteur
heir
heirdom
heiress
heirloom
heirship
+historic
+historical
honest
honestly
honesty
Modified:
trunk/JLanguageTool/src/test/org/languagetool/rules/en/AvsAnRuleTest.java
===================================================================
--- trunk/JLanguageTool/src/test/org/languagetool/rules/en/AvsAnRuleTest.java
2012-05-10 19:52:04 UTC (rev 6861)
+++ trunk/JLanguageTool/src/test/org/languagetool/rules/en/AvsAnRuleTest.java
2012-05-10 19:55:36 UTC (rev 6862)
@@ -91,6 +91,11 @@
//Test on apostrophes
assertCorrect("Its name in English is a[1] (), plural A's, As, as, or
a's.");
+
+ // Both are correct according to Merriam Webster
(http://www.merriam-webster.com/dictionary/a%5B2%5D),
+ // although some people disagree (http://www.theslot.com/a-an.html):
+ assertCorrect("An historic event");
+ assertCorrect("A historic event");
}
private void assertCorrect(String sentence) throws IOException {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Languagetool-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-cvs