Revision: 7326
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=7326&view=rev
Author:   milek_pl
Date:     2012-06-12 17:28:42 +0000 (Tue, 12 Jun 2012)
Log Message:
-----------
[pl] fix false alarms

Modified Paths:
--------------
    
trunk/JLanguageTool/src/java/org/languagetool/tagging/disambiguation/rules/DisambiguationRuleLoader.java
    trunk/JLanguageTool/src/resource/pl/disambiguation.xml
    trunk/JLanguageTool/src/rules/pl/grammar.xml

Modified: 
trunk/JLanguageTool/src/java/org/languagetool/tagging/disambiguation/rules/DisambiguationRuleLoader.java
===================================================================
--- 
trunk/JLanguageTool/src/java/org/languagetool/tagging/disambiguation/rules/DisambiguationRuleLoader.java
    2012-06-12 16:44:56 UTC (rev 7325)
+++ 
trunk/JLanguageTool/src/java/org/languagetool/tagging/disambiguation/rules/DisambiguationRuleLoader.java
    2012-06-12 17:28:42 UTC (rev 7326)
@@ -129,6 +129,9 @@
     } else if (qName.equals(AND)) {
       inAndGroup = true;
       tokenCountForMarker++;
+      if (inUnification) {
+          uniCounter++;
+      }
     } else if (qName.equals(UNIFY)) {
       inUnification = true;           
       uniNegation = YES.equals(attrs.getValue(NEGATE));
@@ -337,11 +340,13 @@
         elementList.add(tokenElement);
       }
       if (inAndGroup) {
-        andGroupCounter++;
+        andGroupCounter++;        
       }
       if (inUnification) {
-        tokenElement.setUnification(equivalenceFeatures);        
-        uniCounter++;
+        tokenElement.setUnification(equivalenceFeatures);
+        if (!inAndGroup) {
+            uniCounter++;
+        }
       }
       if (inUnificationDef) {
         language.getDisambiguationUnifier().setEquivalence(uFeature, uType, 
tokenElement);

Modified: trunk/JLanguageTool/src/resource/pl/disambiguation.xml
===================================================================
--- trunk/JLanguageTool/src/resource/pl/disambiguation.xml      2012-06-12 
16:44:56 UTC (rev 7325)
+++ trunk/JLanguageTool/src/resource/pl/disambiguation.xml      2012-06-12 
17:28:42 UTC (rev 7326)
@@ -125,6 +125,33 @@
         </pattern>
         <disambig action="unify"/>
     </rule>
+    
+        <rulegroup name="co (i) rusz" id="CO_RUSZ">
+        <rule>
+            <pattern >
+                <token regexp="yes">co|ani</token>
+                <marker>
+                    <token>rusz</token>
+                </marker>
+            </pattern>
+            <disambig postag="qub"/>
+            <example type="untouched">Rusz tylko tę książkę!</example>
+            <example type="ambiguous" 
inputform="rusz[rusza/subst:pl:gen:f,ruszyć/verb:impt:sg:sec:perf]" 
outputform="rusz[rusza/qub]">Co <marker>rusz</marker> pyta o godzinę.</example>
+        </rule>
+        <rule>
+            <pattern>
+                <token>co</token>
+                <token>i</token>
+                <marker>
+                    <token>rusz</token>
+                </marker>
+            </pattern>
+            <disambig postag="qub"/>
+            <example type="untouched">Rusz tylko tę książkę!</example>
+            <example type="ambiguous" 
inputform="rusz[rusza/subst:pl:gen:f,ruszyć/verb:impt:sg:sec:perf]" 
outputform="rusz[rusza/qub]">Co i <marker>rusz</marker> pyta o 
godzinę.</example>
+        </rule>
+    </rulegroup>
+    
 
     <rulegroup name="prep + czasownik -> ~ czasownik" id="prep_verb">
         <!--  przyimki zawsze z tym samym przypadkiem -->
@@ -163,6 +190,19 @@
             <example type="untouched">Tu mamy piękny przykład sztuki 
barokowej.</example>
             <example type="ambiguous" 
inputform="mamy[mama/subst:pl:acc:f,mama/subst:pl:nom:f,mama/subst:pl:voc:f,mama/subst:sg:gen:f,mieć/verb:fin:pl:pri:imperf]"
 
outputform="mamy[mama/subst:pl:acc:f,mama/subst:pl:nom:f,mama/subst:pl:voc:f,mama/subst:sg:gen:f]">Stanąłem
 naprzeciw <marker>mamy</marker>.</example>
         </rule>
+        
+       <rule>
+               <pattern>
+                       <unify>
+                               <feature id="case"/>
+                               <token postag="prep:.*" 
postag_regexp="yes"><exception postag="&lt;/?[\p{Lu}:]+&gt;" 
postag_regexp="yes"/><exception postag="prep.*" negate_pos="yes" 
postag_regexp="yes"/></token>                             
+                <token postag_regexp="yes" 
postag="(adj|subst|ppron).*"><exception postag="&lt;/?[\p{Lu}:]+&gt;" 
postag_regexp="yes"/><exception>pewne</exception></token>
+                       </unify>
+               </pattern>
+               <disambig action="unify"/>
+               <example type="untouched">Oni mną papiery.</example>
+               <example type="ambiguous" 
inputform="mną[ja/ppron12:sg:inst:f.m.n.n1.n2:pri,miąć/verb:fin:pl:ter:imperf]" 
outputform="mną[ja/ppron12:sg:inst:f.m.n.n1.n2:pri]">Jedź ze 
<marker>mną</marker>!</example>
+       </rule>
     </rulegroup>
 
        <rule name="do to nie subst" id="do_non_subst">
@@ -177,7 +217,7 @@
         <pattern>
             <unify> <feature id="case"/>
                 <token postag="prep.*" postag_regexp="yes"><exception 
postag="prep.*" negate_pos="yes" 
postag_regexp="yes"/><exception>co</exception><exception 
postag="&lt;/?[\p{Lu}:]+&gt;" postag_regexp="yes"/></token>
-                <token postag="(adj|subst|ppron|ppas):.*" 
postag_regexp="yes"><exception>co</exception><exception 
postag="&lt;/?[\p{Lu}:]+&gt;|qub" postag_regexp="yes"/></token>
+                <token postag="(adj|subst|ppron.*|ppas):.*" 
postag_regexp="yes"><exception>co</exception><exception 
postag="&lt;/?[\p{Lu}:]+&gt;|qub" postag_regexp="yes"/></token>
             </unify>
         </pattern>
         <disambig action="unify"></disambig>
@@ -507,32 +547,6 @@
         </rule>
     </rulegroup>
 
-    <rulegroup name="co (i) rusz" id="CO_RUSZ">
-        <rule>
-            <pattern >
-                <token regexp="yes">co|ani</token>
-                <marker>
-                    <token>rusz</token>
-                </marker>
-            </pattern>
-            <disambig postag="qub"/>
-            <example type="untouched">Rusz tylko tę książkę!</example>
-            <example type="ambiguous" 
inputform="rusz[rusza/subst:pl:gen:f,ruszyć/verb:impt:sg:sec:perf]" 
outputform="rusz[rusza/qub]">Co <marker>rusz</marker> pyta o godzinę.</example>
-        </rule>
-        <rule>
-            <pattern>
-                <token>co</token>
-                <token>i</token>
-                <marker>
-                    <token>rusz</token>
-                </marker>
-            </pattern>
-            <disambig postag="qub"/>
-            <example type="untouched">Rusz tylko tę książkę!</example>
-            <example type="ambiguous" 
inputform="rusz[rusza/subst:pl:gen:f,ruszyć/verb:impt:sg:sec:perf]" 
outputform="rusz[rusza/qub]">Co i <marker>rusz</marker> pyta o 
godzinę.</example>
-        </rule>
-    </rulegroup>
-
        <!--  TODO: czy to nadal potrzebne po PoliMorfie? -->
     <rule name="skrótowce jako nieodmienne" id="SKROTOWCE_IRREG">
         <pattern>

Modified: trunk/JLanguageTool/src/rules/pl/grammar.xml
===================================================================
--- trunk/JLanguageTool/src/rules/pl/grammar.xml        2012-06-12 16:44:56 UTC 
(rev 7325)
+++ trunk/JLanguageTool/src/rules/pl/grammar.xml        2012-06-12 17:28:42 UTC 
(rev 7326)
@@ -949,7 +949,7 @@
                 <short>Błąd interpunkcyjny</short>
                 <example type="correct">To tyle, co nic.</example>
                 <example correction="tyle, co" type="incorrect">To 
<marker>tyle co</marker> nic.</example>
-            </rule>
+            </rule>             
             <rule>
                 <pattern>
                     <marker>
@@ -968,7 +968,7 @@
                 <example type="correct">Naprawdę nie masz za co 
dziękować.</example>
                 <example correction="Oto, do" type="incorrect"><marker>Oto 
do</marker> czego doprowadziły rządy ludzi niespełna rozumu.</example>
                 <example type="correct">Spotykamy się w co drugi 
piątek.</example>
-            </rule>
+            </rule>            
             <rule>
                 <pattern>
                     <marker>

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

Reply via email to