Package weka.core

Examples of weka.core.Trie$TrieIterator


  // init packages
  m_Packages = new Vector<String>();
  m_Packages.addAll(set);
  Collections.sort(m_Packages);
 
  m_Trie = new Trie();
  m_Trie.addAll(m_Packages);
      }
    }
View Full Code Here


      String    cls;
      Vector<String>   result;
      Vector<String>   list;
      int    i;
      int    index;
      Trie    tmpTrie;
      HashSet    set;
      String    tmpStr;
     
      pkg = getPackage(partial);
      cls = getClassname(partial);
     
      if (getDebug())
  System.out.println(
      Messages.getInstance().getString("SimpleCLIPanel_CommandlineCompletion_GetClassMatches_Text_First") + partial + Messages.getInstance().getString("SimpleCLIPanel_CommandlineCompletion_GetClassMatches_Text_Second") + pkg + Messages.getInstance().getString("SimpleCLIPanel_CommandlineCompletion_GetClassMatches_Text_Third") + cls);

      result = new Vector<String>();

      // find all packages that start with that string
      if (cls.length() == 0) {
  list = m_Trie.getWithPrefix(pkg);
  set  = new HashSet();
  for (i = 0; i < list.size(); i++) {
    tmpStr = list.get(i);
    if (tmpStr.length() < partial.length())
      continue;
    if (tmpStr.equals(partial))
      continue;
   
    index  = tmpStr.indexOf('.', partial.length() + 1);
    if (index > -1)
      set.add(tmpStr.substring(0, index));
    else
      set.add(tmpStr);
  }

  result.addAll(set);
  if (result.size() > 1)
    Collections.sort(result);
      }

      // find all classes that start with that string
      list = ClassDiscovery.find(Object.class, pkg);
      tmpTrie = new Trie();
      tmpTrie.addAll(list);
      list = tmpTrie.getWithPrefix(partial);
      result.addAll(list);
     
      // sort the result
      if (result.size() > 1)
  Collections.sort(result);
View Full Code Here

     * @param list  the list to return the common prefix for
     * @return    the common prefix of all the items
     */
    public String getCommonPrefix(Vector<String> list) {
      String  result;
      Trie  trie;
     
      trie = new Trie();
      trie.addAll(list);
      result = trie.getCommonPrefix();
     
      if (m_Debug)
  System.out.println(list + Messages.getInstance().getString("SimpleCLIPanel_CommandlineCompletion_GetCommonPrefix_Text_First") + result + Messages.getInstance().getString("SimpleCLIPanel_CommandlineCompletion_GetCommonPrefix_Text_Second"));
     
      return result;
View Full Code Here

  // init packages
  m_Packages = new Vector<String>();
  m_Packages.addAll(set);
  Collections.sort(m_Packages);
 
  m_Trie = new Trie();
  m_Trie.addAll(m_Packages);
      }
    }
View Full Code Here

      String    cls;
      Vector<String>   result;
      Vector<String>   list;
      int    i;
      int    index;
      Trie    tmpTrie;
      HashSet    set;
      String    tmpStr;
     
      pkg = getPackage(partial);
      cls = getClassname(partial);
     
      if (getDebug())
  System.out.println(
      "\nsearch for: '" + partial + "' => package=" + pkg + ", class=" + cls);

      result = new Vector<String>();

      // find all packages that start with that string
      if (cls.length() == 0) {
  list = m_Trie.getWithPrefix(pkg);
  set  = new HashSet();
  for (i = 0; i < list.size(); i++) {
    tmpStr = list.get(i);
    if (tmpStr.length() < partial.length())
      continue;
    if (tmpStr.equals(partial))
      continue;
   
    index  = tmpStr.indexOf('.', partial.length() + 1);
    if (index > -1)
      set.add(tmpStr.substring(0, index));
    else
      set.add(tmpStr);
  }

  result.addAll(set);
  if (result.size() > 1)
    Collections.sort(result);
      }

      // find all classes that start with that string
      list = ClassDiscovery.find(Object.class, pkg);
      tmpTrie = new Trie();
      tmpTrie.addAll(list);
      list = tmpTrie.getWithPrefix(partial);
      result.addAll(list);
     
      // sort the result
      if (result.size() > 1)
  Collections.sort(result);
View Full Code Here

     * @param list  the list to return the common prefix for
     * @return    the common prefix of all the items
     */
    public String getCommonPrefix(Vector<String> list) {
      String  result;
      Trie  trie;
     
      trie = new Trie();
      trie.addAll(list);
      result = trie.getCommonPrefix();
     
      if (m_Debug)
  System.out.println(list + "\n  --> common prefix: '" + result + "'");
     
      return result;
View Full Code Here

  // init packages
  m_Packages = new Vector<String>();
  m_Packages.addAll(set);
  Collections.sort(m_Packages);
 
  m_Trie = new Trie();
  m_Trie.addAll(m_Packages);
      }
    }
View Full Code Here

      String    cls;
      Vector<String>   result;
      Vector<String>   list;
      int    i;
      int    index;
      Trie    tmpTrie;
      HashSet    set;
      String    tmpStr;
     
      pkg = getPackage(partial);
      cls = getClassname(partial);
     
      if (getDebug())
  System.out.println(
      "\nsearch for: '" + partial + "' => package=" + pkg + ", class=" + cls);

      result = new Vector<String>();

      // find all packages that start with that string
      if (cls.length() == 0) {
  list = m_Trie.getWithPrefix(pkg);
  set  = new HashSet();
  for (i = 0; i < list.size(); i++) {
    tmpStr = list.get(i);
    if (tmpStr.length() < partial.length())
      continue;
    if (tmpStr.equals(partial))
      continue;
   
    index  = tmpStr.indexOf('.', partial.length() + 1);
    if (index > -1)
      set.add(tmpStr.substring(0, index));
    else
      set.add(tmpStr);
  }

  result.addAll(set);
  if (result.size() > 1)
    Collections.sort(result);
      }

      // find all classes that start with that string
      list = ClassDiscovery.find(Object.class, pkg);
      tmpTrie = new Trie();
      tmpTrie.addAll(list);
      list = tmpTrie.getWithPrefix(partial);
      result.addAll(list);
     
      // sort the result
      if (result.size() > 1)
  Collections.sort(result);
View Full Code Here

     * @param list  the list to return the common prefix for
     * @return    the common prefix of all the items
     */
    public String getCommonPrefix(Vector<String> list) {
      String  result;
      Trie  trie;
     
      trie = new Trie();
      trie.addAll(list);
      result = trie.getCommonPrefix();
     
      if (m_Debug)
  System.out.println(list + "\n  --> common prefix: '" + result + "'");
     
      return result;
View Full Code Here

TOP

Related Classes of weka.core.Trie$TrieIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.