Package gannuUtil

Examples of gannuUtil.KeyArray


        {
          tokens=line.split(" ");
          int x=tokens[0].split("_").length;
          if(x>maxCollocationSize)
            maxCollocationSize=x;
          senseMaps.add(new KeyArray(tokens[0]+pos, parseSenseMap(tokens,pos)));
        }
        line=in.readLine();
      }
      in.close();
      inf.close();
View Full Code Here


      Element param=(Element)nodes.item(i);
      String config=param.getAttribute("config");
      if(!config.contains("["))//simple config string
      {
        String []tokens=config.split(":");
        KeyArray ka=new KeyArray(tokens[0],tokens[1]);
        if(configs.contains(ka))
        {
          configs.get(configs.indexOf(ka)).getArray().add(tokens[1]);
        }
        else
        {
          configs.add(ka);
        }
      }
     
      else
      {
        //Process the config that contains a list
        String tokens[]=config.replace("[", "").replace("]", "").split(":");
        String head=tokens[0];
        String tail=tokens[1];
        String values[]=tail.split(",");
        boolean isdouble=values[0].contains(".");
        for(int x=0;x<values.length;x++)
        {
          String value=values[x];
          if(value.equals("..."))
          {
            if(isdouble)
            {
              double base=Double.parseDouble(values[x-2]);
              double next=Double.parseDouble(values[x-1]);
              double inc=next-base;
              double current=next+inc;
              double end=Double.parseDouble(values[x+1]);
              while(current<end)
              {
                KeyArray ka=new KeyArray(head,String.valueOf(current));
                if(configs.contains(ka))
                {
                  configs.get(configs.indexOf(ka)).getArray().add(String.valueOf(current));
                }
                else
                {
                  configs.add(ka);
                }
                current+=inc;
              }
            }
            else
            {
              int base=Integer.parseInt(values[x-2]);
              int next=Integer.parseInt(values[x-1]);
              int inc=next-base;
              int current=next+inc;
              int end=Integer.parseInt(values[x+1]);
              while(current<end)
              {
                KeyArray ka=new KeyArray(head,String.valueOf(current));
                if(configs.contains(ka))
                {
                  configs.get(configs.indexOf(ka)).getArray().add(String.valueOf(current));
                }
                else
                {
                  configs.add(ka);
                }
                current+=inc;
              }
            }
          }
          else
          {
            KeyArray ka=new KeyArray(head,values[x]);
            if(configs.contains(ka))
            {
              configs.get(configs.indexOf(ka)).getArray().add(values[x]);
            }
            else
View Full Code Here

TOP

Related Classes of gannuUtil.KeyArray

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.