Revision: 16794
          http://sourceforge.net/p/gate/code/16794
Author:   markagreenwood
Date:     2013-08-15 19:59:09 +0000 (Thu, 15 Aug 2013)
Log Message:
-----------
more generics stuff

Modified Paths:
--------------
    gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/Lemma.java
    gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/LemmaImpl.java
    
gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/SuffixNest.java
    
gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/SuffixNestImpl.java

Modified: 
gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/Lemma.java
===================================================================
--- gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/Lemma.java    
2013-08-15 18:46:17 UTC (rev 16793)
+++ gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/Lemma.java    
2013-08-15 19:59:09 UTC (rev 16794)
@@ -65,31 +65,31 @@
 /**
  * Fetch a set of the word-form suffixes in the lemma according to the root.
  * @return the word-form suffixes in this lemma */
-public Set getSuffixes() ;
+public Set<String> getSuffixes() ;
 
 /**
  * Get the set of types relevant to a word-form
  * @param wf the word-form
  * @return the set of types relevant to the word-form
  */
-Set getTypeByWF(String wf) ;
+Set<String> getTypeByWF(String wf) ;
 
 /**
  * Get the set of types relevant to a word-form suffix
  * @param suffix the suffix of the wf
  * @return the set of types relevant to the word-form with this suffix
  */
-Set getTypeBySuffix(String suffix) ;
+Set<String> getTypeBySuffix(String suffix) ;
 
 /**
  * Fetch a set of the word-forms in the lemma.
  * @return the word-forms in this lemma */
-Set getWordForms();
+Set<String> getWordForms();
 
 /**
  * Fetch the set of word-form types in the lemma
  * @return the set of word-form types in the lemma */
-Set getTypes();
+Set<String> getTypes();
 
 /**Get the suffix nest associated with this lemma.
  * @return the nest */

Modified: 
gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/LemmaImpl.java
===================================================================
--- 
gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/LemmaImpl.java    
    2013-08-15 18:46:17 UTC (rev 16793)
+++ 
gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/LemmaImpl.java    
    2013-08-15 19:59:09 UTC (rev 16794)
@@ -123,7 +123,7 @@
    * @param wf the word-form
    * @return the set of types relevant to the word-form
    */
-  public Set getTypeByWF(String wf) {
+  public Set<String> getTypeByWF(String wf) {
     return suffixNest.getType(wf.substring(root.length()));
   }
 
@@ -132,7 +132,7 @@
    * @param suffix the suffix of the wf
    * @return the set of types relevant to the word-form with this suffix
    */
-  public Set getTypeBySuffix(String suffix) {
+  public Set<String> getTypeBySuffix(String suffix) {
     return suffixNest.getType(suffix);
   }
 
@@ -140,11 +140,10 @@
   /**
    * Fetch a set of the word-forms in the lemma.
    * @return the word-forms in this lemma */
-  public Set getWordForms() {
-    Set sufs = suffixNest.getSuffixes();
-    Iterator it = sufs.iterator();
-    String suf;
-    Set wfs = new HashSet();
+  public Set<String> getWordForms() {
+    Set<String> sufs = suffixNest.getSuffixes();
+    Iterator<String> it = sufs.iterator();
+    Set<String> wfs = new HashSet<String>();
     while (it.hasNext()) {
       wfs.add(root+ it.next());
     }
@@ -155,7 +154,7 @@
   /**
    * Fetch a set of the word-form suffixes in the lemma according to the root.
    * @return the word-form suffixes in this lemma */
-  public Set getSuffixes() {
+  public Set<String> getSuffixes() {
     return suffixNest.getSuffixes();
   } /// getSuffixes()
 

Modified: 
gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/SuffixNest.java
===================================================================
--- 
gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/SuffixNest.java   
    2013-08-15 18:46:17 UTC (rev 16793)
+++ 
gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/SuffixNest.java   
    2013-08-15 19:59:09 UTC (rev 16794)
@@ -1,5 +1,7 @@
 package com.ontotext.russie.morph;
 
+import gate.FeatureMap;
+
 import java.util.Set;
 
 /**SuffixNest.java
@@ -48,21 +50,21 @@
    * Get all morpho-syntactic types.
    * @return all morpho-syntactic types
    */
-  Set getTypes();
+  Set<String> getTypes();
 
   /**
    * Gets the set of types associated with a suffix
    * @param suffix
    * @return the set of types associated with the suffix
    */
-  Set getType(String suffix);
+  Set<String> getType(String suffix);
 
   /**Adds a prefix to all suffixes in the nest
    * @param prefix
    */
   void addPrefix2Suffixes(String prefix);
 
-  gate.FeatureMap getFeatureMap () ;
-  void setFeatureMap (gate.FeatureMap fm) ;
+  FeatureMap getFeatureMap () ;
+  void setFeatureMap (FeatureMap fm) ;
 
 } // class SuffixNest
\ No newline at end of file

Modified: 
gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/SuffixNestImpl.java
===================================================================
--- 
gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/SuffixNestImpl.java
   2013-08-15 18:46:17 UTC (rev 16793)
+++ 
gate/trunk/plugins/Lang_Russian/src/com/ontotext/russie/morph/SuffixNestImpl.java
   2013-08-15 19:59:09 UTC (rev 16794)
@@ -25,12 +25,12 @@
 public class SuffixNestImpl implements SuffixNest {
 
   /** map of word-form suffixes vs types */
-  private Map<String, Object> suffixVsType;
+  private Map<String, Set<String>> suffixVsType;
   private String mainFormSuffix = "";
   private FeatureMap fm = Factory.newFeatureMap();
 
   public SuffixNestImpl() {
-    suffixVsType = new HashMap<String, Object>();
+    suffixVsType = new HashMap<String, Set<String>>();
   }
 
   /**
@@ -74,7 +74,7 @@
    * @param typeSet the set of types
    */
   public void add(String suffix, Set<String> typeSet)  {
-    Set<String> set = (Set<String>)suffixVsType.get(suffix);
+    Set set = (Set)suffixVsType.get(suffix);
     if (set != null) {
       typeSet.addAll(set);
     }
@@ -93,18 +93,18 @@
    * Get all morpho-syntactic types.
    * @return all morpho-syntactic types
    */
-  public Set<Object> getTypes() {
-    Iterator<Object> it = suffixVsType.values().iterator();
-    Set<Object> allTypes = new HashSet<Object>();
+  public Set<String> getTypes() {
+    Iterator<Set<String>> it = suffixVsType.values().iterator();
+    Set<String> allTypes = new HashSet<String>();
     Object o;
     while (it.hasNext()) {
       o = it.next();
       if ( o == null ) continue;
       if (o instanceof Set) {
-        allTypes.addAll((Set)o);
+        allTypes.addAll((Set<String>)o);
       }
       if (o instanceof String) {
-        allTypes.add(o);
+        allTypes.add((String)o);
       }
     } // while there are type sets
     return allTypes;
@@ -115,8 +115,8 @@
    * @param suffix
    * @return the set of types associated with the suffix
    */
-  public Set<Object> getType(String suffix) {
-    return (Set<Object>)suffixVsType.get(suffix);
+  public Set getType(String suffix) {
+    return (Set)suffixVsType.get(suffix);
   }
 
   public int hashCode() {
@@ -140,9 +140,9 @@
    */
   public void addPrefix2Suffixes(String prefix) {
     Iterator<String> ki = suffixVsType.keySet().iterator();
-    Object types;
+    Set<String> types;
     String suffix;
-    Map<String, Object> suffixVsTypeNew = new HashMap<String, Object>();
+    Map<String, Set<String>> suffixVsTypeNew = new HashMap<String, 
Set<String>>();
     while(ki.hasNext()) {
       suffix = ki.next();
       types = suffixVsType.get(suffix);

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


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to