Revision: 8252
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=8252&view=rev
Author:   jaumeortola
Date:     2012-10-22 13:30:15 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
[ca] Fix some false alarms. Disable more rules for Wikipedia check.

Modified Paths:
--------------
    
trunk/JLanguageTool/src/main/java/org/languagetool/rules/ca/AccentuationCheckRule.java
    
trunk/JLanguageTool/src/main/resources/org/languagetool/resource/ca/disambiguation.xml
    
trunk/JLanguageTool/src/main/resources/org/languagetool/resource/ltcommunity/disabled_rules.properties
    trunk/JLanguageTool/src/main/resources/org/languagetool/rules/ca/grammar.xml
    
trunk/JLanguageTool/src/test/java/org/languagetool/rules/ca/AccentuationCheckRuleTest.java

Modified: 
trunk/JLanguageTool/src/main/java/org/languagetool/rules/ca/AccentuationCheckRule.java
===================================================================
--- 
trunk/JLanguageTool/src/main/java/org/languagetool/rules/ca/AccentuationCheckRule.java
      2012-10-21 21:04:49 UTC (rev 8251)
+++ 
trunk/JLanguageTool/src/main/java/org/languagetool/rules/ca/AccentuationCheckRule.java
      2012-10-22 13:30:15 UTC (rev 8252)
@@ -78,6 +78,7 @@
   private static final Pattern BEFORE_ADJECTIVE_FS = 
Pattern.compile("SPS00|D[^R].[FC][SN].*|V.[^NGP].*|PX.*");
   private static final Pattern BEFORE_ADJECTIVE_MP = 
Pattern.compile("SPS00|D[^R].[MC][PN].*|V.[^NGP].*|PX.*");
   private static final Pattern BEFORE_ADJECTIVE_FP = 
Pattern.compile("SPS00|D[^R].[FC][PN].*|V.[^NGP].*|PX.*");
+  private static final Pattern GN = Pattern.compile("_GN_.*");
       
   private final Map<String, AnalyzedTokenReadings> relevantWords;
   private final Map<String, AnalyzedTokenReadings> relevantWords2;
@@ -104,7 +105,7 @@
   public RuleMatch[] match(final AnalyzedSentence text) {
     final List<RuleMatch> ruleMatches = new ArrayList<RuleMatch>();
     final AnalyzedTokenReadings[] tokens = text.getTokensWithoutWhitespace();
-    for (int i = 1; i < tokens.length; i++) {   //ignoring token 0, i.e., 
SENT_START
+    for (int i = 1; i < tokens.length; i++) {   //ignoring token 0, i.e., 
SENT_START      
       final String token;
       if (i == 1) {
         token=tokens[i].getToken().toLowerCase();
@@ -144,7 +145,7 @@
       final Matcher mArticleELFP = ARTICLE_EL_FP.matcher(prevToken);
 
       // verb without accent -> noun with accent   
-      if (isRelevantWord)
+      if (isRelevantWord && !matchPostagRegexp(tokens[i],GN))
       {
        //amb renuncies
         if (tokens[i-1].hasPosTag("SPS00") && 
!matchPostagRegexp(tokens[i-1],DETERMINANT) && 
!matchPostagRegexp(tokens[i],INFINITIU) )
@@ -236,7 +237,7 @@
       }
 
       // verb without accent -> adjective with accent
-      if (isRelevantWord2)
+      if (isRelevantWord2 && !matchPostagRegexp(tokens[i],GN))
       {
         // de manera obvia, circumstàncies extraordinaries.
          if (    (matchPostagRegexp(relevantWords2.get(token),ADJECTIU_MS) && 
matchPostagRegexp(tokens[i-1],NOM_MS) && !tokens[i-1].hasPosTag("_GN_FS") && 
matchPostagRegexp(tokens[i],VERB_CONJUGAT) )

Modified: 
trunk/JLanguageTool/src/main/resources/org/languagetool/resource/ca/disambiguation.xml
===================================================================
--- 
trunk/JLanguageTool/src/main/resources/org/languagetool/resource/ca/disambiguation.xml
      2012-10-21 21:04:49 UTC (rev 8251)
+++ 
trunk/JLanguageTool/src/main/resources/org/languagetool/resource/ca/disambiguation.xml
      2012-10-22 13:30:15 UTC (rev 8252)
@@ -1018,7 +1018,7 @@
                     </and>
                 </marker>
             </pattern>
-            <disambig action="filter" postag="N.*|A.*|V.P.*" /> <!-- les ha 
vistes estenent la roba -->
+            <disambig action="filter" postag="N.*|A.*|V.P.*|PX.*" /> <!-- les 
ha vistes estenent la roba -->
         </rule>
     </rulegroup>
     <rulegroup id="noms_aposicio" name="noms en aposició">
@@ -3982,7 +3982,7 @@
                     </and>
                 </marker>
             </unify>
-            <token postag="N.*" postag_regexp="yes"><exception 
postag="V.[MSI].*|AQ.*|V.P.*" postag_regexp="yes"/><exception 
regexp="yes">\p{Lu}.+</exception></token>
+            <token postag="N.*" postag_regexp="yes"><exception 
postag="V.[MSI].*|AQ.*|V.P.*|PX.*" postag_regexp="yes"/><exception 
regexp="yes">\p{Lu}.+</exception></token>
         </pattern>
         <disambig action="filter" postag="AQ.*"></disambig>
     </rule>
@@ -5041,7 +5041,7 @@
                     <token postag="A.*" postag_regexp="yes"><exception 
postag="_GN_.*" postag_regexp="yes"/></token>
                 </and>
             </marker>
-            <token postag="N.*" postag_regexp="yes"></token>
+            <token postag="N.*" postag_regexp="yes"><exception 
postag="V.[SI].*" postag_regexp="yes"/></token>
         </pattern>
         <disambig action="filter" postag="V.*"></disambig>
     </rule>

Modified: 
trunk/JLanguageTool/src/main/resources/org/languagetool/resource/ltcommunity/disabled_rules.properties
===================================================================
--- 
trunk/JLanguageTool/src/main/resources/org/languagetool/resource/ltcommunity/disabled_rules.properties
      2012-10-21 21:04:49 UTC (rev 8251)
+++ 
trunk/JLanguageTool/src/main/resources/org/languagetool/resource/ltcommunity/disabled_rules.properties
      2012-10-22 13:30:15 UTC (rev 8252)
@@ -9,4 +9,4 @@
 sl=POMIŠLJAJ_1,POMIŠLJAJ_2,POMIŠLJAJ_3
 en=EN_QUOTES,EN_UNPAIRED_BRACKETS
 ru=RU_UNPAIRED_BRACKETS
-ca=GUIONET_SOLT,EVITA_ACCENTUACIO_VALENCIANA,EVITA_VERBS_VALENCIANS,EVITA_VERBS_BALEARS,EVITA_VERBS_BALEARS_VALENCIANS,EVITA_POSSESSIUS_U,EVITA_PRONOMS_VALENCIANS,DEMOSTRATIUS_ESTE_EIXE,PUNTS_SUSPENSIUS
+ca=GUIONET_SOLT,EVITA_ACCENTUACIO_VALENCIANA,EVITA_VERBS_VALENCIANS,EVITA_VERBS_BALEARS,EVITA_VERBS_BALEARS_VALENCIANS,EVITA_POSSESSIUS_U,EVITA_PRONOMS_VALENCIANS,DEMOSTRATIUS_ESTE,DEMOSTRATIUS_EIXE,PUNTS_SUSPENSIUS

Modified: 
trunk/JLanguageTool/src/main/resources/org/languagetool/rules/ca/grammar.xml
===================================================================
--- 
trunk/JLanguageTool/src/main/resources/org/languagetool/rules/ca/grammar.xml    
    2012-10-21 21:04:49 UTC (rev 8251)
+++ 
trunk/JLanguageTool/src/main/resources/org/languagetool/rules/ca/grammar.xml    
    2012-10-22 13:30:15 UTC (rev 8252)
@@ -1342,12 +1342,13 @@
                     <marker>
                         <token postag="V.P.*" postag_regexp="yes" 
inflected="yes">adormir</token>
                     </marker>
-                    <token><exception postag="_GN_.*" postag_regexp="yes" 
/></token>
+                    <token><exception postag="_GN_.*|NP.*" postag_regexp="yes" 
/></token>
                 </pattern>
                 <message>¿Volíeu dir <suggestion><match no="3" 
regexp_match="a(dorm.*)" regexp_replace="$1"/></suggestion>?</message>
                 <example type="incorrect">Joan ha 
<marker>adormit</marker>.</example>
                 <example type="correct">Joan ha adormit la nena.</example>
                 <example type="correct">Joan l'ha adormit.</example>
+                <example type="correct">Jahvè va adormir Adam</example>
             </rule>
              <rule>
                 <pattern>
@@ -1593,7 +1594,7 @@
             <rule id="CALDRE" name="Comprova: «caldre» seguit de verb en 
infinitiu">
                 <pattern>
                     <marker>
-                        <token inflected="yes">caldre</token>
+                        <token inflected="yes">caldre<exception 
postag="_GN_MS"/></token>
                         <token postag="VM[^N].*" postag_regexp="yes" 
regexp="yes">[\p{Ll}·]+<exception postag="[^V].*" postag_regexp="yes"/></token>
                     </marker>
                 </pattern>
@@ -1601,6 +1602,7 @@
                 <example type="incorrect">No <marker>cal 
corre</marker>.</example>
                 <example type="correct">No cal córrer.</example>
                 <example type="correct">Anem a cal Cego.</example>
+                <example type="correct">El model estàndard del Big Bang calent 
erra en l'objectiu</example>
             </rule>
             <rule id="CALDRE_DE" name="Caldre (*de) + infinitiu">
                 <pattern>
@@ -2083,8 +2085,8 @@
         </rule>
         <rule id="CONFUSIO_PARTICIPI_INFINITIU" name="Nom + adverbi + 
(*infinitiu/*gerundi/participi)">
             <pattern>
-                <token postag="N.[MC][SN].*" postag_regexp="yes"><exception 
postag="V.[SI].*" postag_regexp="yes"/></token>
-                <token postag="RG" 
regexp="yes">.+ment|molt|poc|tant|tan|aleshores|alhora|almanco|almenys|aviat|ben|encara|força|gaire|gairebé|gens|inclús|ja|llavors|mai|massa|menys|mig|millor|més|no|només|pas|pitjor|potser|prompte|prou|quasi|quelcom|sempre|sobretot|sols|suara|també|tampoc|tanmateix|tostemps|tot|tothora|àdhuc</token>
+                <token postag="N.[MC][SN].*" postag_regexp="yes"><exception 
postag="V.[SI].*" postag_regexp="yes"/><exception 
inflected="yes">numeral</exception></token>
+                <token postag="RG_anteposat"><exception 
regexp="yes">tot|també</exception></token>
                 <marker>
                     <token postag="V.[GN].*" postag_regexp="yes"><exception 
postag="A.*|V.P.*" postag_regexp="yes"/></token>
                 </marker>
@@ -2096,6 +2098,8 @@
             <example type="correct">un país secularment humanitzat com el 
nostre</example>
             <example type="correct">i pot també produir</example>
             <example type="correct">el mineral més dur conegut</example>
+            <example type="correct">enllaçat a tres més formant un 
pla</example>
+            <example type="correct">a Colom tot indicant-li que 
emetria</example>
         </rule>
         <rulegroup id="DONAR_FER" name="donar/fer">
             <rule>
@@ -2288,7 +2292,7 @@
     <category name="Determinants">
         <rulegroup id="DETERMINANTS_IMPOSSIBLE" name="Combinacions impossibles 
de determinants: *els tots els">
             <!--  falten combinacions de dos: els aquests -->
-            <rule>
+            <!-- <rule>
                 <pattern>
                     <marker>
                     <token postag="D.*" postag_regexp="yes"></token>
@@ -2303,7 +2307,7 @@
                 <example type="correct">els tres mil</example>
                 <example type="correct">els trenta-quatre mil 
restants</example>
                 <example type="correct">totes les quals sumes</example>
-            </rule>
+            </rule> -->
             <rule>
                 <pattern>
                     <token>els</token>
@@ -13266,7 +13270,7 @@
         </rule>
     </category>    
     <category name="Sintaxi">
-        <rulegroup id="RELATIUS" name="Comprova les contruccions de relatiu: 
amb el que/amb el qual" default="off">
+        <rulegroup id="RELATIUS" name="Comprova les contruccions de relatiu: 
amb el que/amb el qual" default="on">
             <rule>
                 <pattern>
                     <token postag="NCMS.*|_GN_MS" postag_regexp="yes"/>

Modified: 
trunk/JLanguageTool/src/test/java/org/languagetool/rules/ca/AccentuationCheckRuleTest.java
===================================================================
--- 
trunk/JLanguageTool/src/test/java/org/languagetool/rules/ca/AccentuationCheckRuleTest.java
  2012-10-21 21:04:49 UTC (rev 8251)
+++ 
trunk/JLanguageTool/src/test/java/org/languagetool/rules/ca/AccentuationCheckRuleTest.java
  2012-10-22 13:30:15 UTC (rev 8252)
@@ -43,6 +43,7 @@
   public void testRule() throws IOException {
 
     // correct sentences:
+       assertCorrect("els següents territoris externs habitats:");
        assertCorrect("Cap faria una cosa així.");
        assertCorrect("El cos genera suficient pressió interna.");
        assertCorrect("Les seues contràries.");
@@ -82,7 +83,7 @@
     assertIncorrect("De manera obvia.");
     assertIncorrect("Ell fa tasques especifiques.");
     assertIncorrect("Un home adulter.");
-    assertIncorrect("Va deixar els nens atonits.");
+   // assertIncorrect("Va deixar els nens atonits."); del v. "atonir" 
(=esbalair)
     assertIncorrect("La sureda ocupa amplies extensions en la muntanya.");
     assertIncorrect("Féu una magnifica digitació.");
     assertIncorrect("Els habitats de la comarca.");

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Languagetool-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-commits

Reply via email to