[Mmil-commits] r26 - trunk/src/fr/loria/led/mmil

alexandredenis at users.gforge.inria.fr alexandredenis at users.gforge.inria.fr
Mer 4 Oct 10:48:22 CEST 2006


Author: alexandredenis
Date: 2006-10-04 08:48:21 +0000 (Wed, 04 Oct 2006)
New Revision: 26

Modified:
   trunk/src/fr/loria/led/mmil/MMILComponent.java
   trunk/src/fr/loria/led/mmil/MMILEntity.java
Log:


Modified: trunk/src/fr/loria/led/mmil/MMILComponent.java
===================================================================
--- trunk/src/fr/loria/led/mmil/MMILComponent.java	2006-10-04 07:52:57 UTC (rev 25)
+++ trunk/src/fr/loria/led/mmil/MMILComponent.java	2006-10-04 08:48:21 UTC (rev 26)
@@ -505,14 +505,16 @@
         for(MMILRelation rel : getRelationsByEntityTarget(e1))
             rel.setTarget(e2);
     }
- 
 
     /**
-        Aggregate the entities of this component serially.
+        Aggregate serially the entities of this component.
         It tries to unify the entities sorted along their left index, ie. the unification of each entity
-        is tested with its successor.
+        is tested with its successor. A synonyms list could be given to relax the constraints on the unification.
+        One can also indicates if the features of the successor should be preferred or not in the case of a synonymy.
+        @param synonyms a list of synonyms lists considered as equivalent values for a feature
+        @param succPrior a boolean indicating if the features of the successor are preferred or not
     */
-    public void aggregateSerial()
+    public void aggregateSerial(List<List<String>> synonyms, boolean succPrior)
     {
         if (entities.size()<=1)
             return;
@@ -524,7 +526,7 @@
         
         for(int i=1; i<entities.size(); i++)
         {
-            MMILEntity unif = curEntity.unify(entities.get(i));
+            MMILEntity unif = succPrior ? entities.get(i).unify(curEntity,synonyms) : curEntity.unify(entities.get(i),synonyms);
             if (unif==null)
             {
                 newEntities.add(curEntity);
@@ -539,6 +541,16 @@
 
         newEntities.add(curEntity);
         setEntities(newEntities);
+    }
+    
+
+    /**
+        Aggregate the entities of this component serially.
+        Proceed to the aggregation without synonyms and a preference for successor features.
+    */
+    public void aggregateSerial()
+    {
+        aggregateSerial(new ArrayList<List<String>>(),true);
     }       
 
 

Modified: trunk/src/fr/loria/led/mmil/MMILEntity.java
===================================================================
--- trunk/src/fr/loria/led/mmil/MMILEntity.java	2006-10-04 07:52:57 UTC (rev 25)
+++ trunk/src/fr/loria/led/mmil/MMILEntity.java	2006-10-04 08:48:21 UTC (rev 26)
@@ -276,7 +276,7 @@
         }
         for(MMILFeature feat : entity.getFeatures())
         {
-            List<String> values = synonymize(getValuesOf(feat.getName(), synonyms));
+            List<String> values = synonymize(getValuesOf(feat.getName()), synonyms);
             if (values.isEmpty() || containsIgnoreCase(values, feat.getValue()))
             {
                 if (!ret.hasFeature(feat.getNamespace(), feat.getName(), feat.getValue()))






Plus d'informations sur la liste de diffusion Mmil-commits