Package opennlp.ccg.alignment

Examples of opennlp.ccg.alignment.Alignment$IndexView


                    Status.forAbbreviation(a.getAttribute("status"))));
          }
        }
      }
     
      Alignment a = new Alignment(new Phrase(id,
            Alignments.tokenize(first.getElementsByTagName("string").item(0).getTextContent())),
              new Phrase(id,
                Alignments.tokenize(second.getElementsByTagName("string").item(0).getTextContent())),
            ms);
     
      Element firstLF = (Element)first.getElementsByTagName("lf").item(0),
          secondLF = (Element)second.getElementsByTagName("lf").item(0);
     
      LFGraphDifference diff = (firstLF != null && secondLF != null)
          ? new LFGraphDifference(LFGraphFactory.newGraphFrom(firstLF),
              LFGraphFactory.newGraphFrom(secondLF), a)
          : null;
     
      for(PhrasePosition pos : PhrasePosition.values()) {
        Element str = out.createElement("string");
        str.setAttribute("number", Integer.toString(id));
        str.setAttribute("position", pos.name());
        str.setTextContent(Alignments.untokenize(a.get(pos)));
       
        dlfsElement.appendChild(str);
      }
     
      Element msEl = out.createElement("mappings");
View Full Code Here


  @SuppressWarnings("unchecked")
  @Before
  public void setUp() throws Exception {
    super.setUp();
   
    alignment = new Alignment(new Phrase(337, "A", "boy", "walks", "quickly"),
        new Phrase(337, "He", "moves"),
        Collections.EMPTY_SET);
   
    alignment.add(new Mapping(0, 0));
    alignment.add(new Mapping(1, 0));
View Full Code Here

TOP

Related Classes of opennlp.ccg.alignment.Alignment$IndexView

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.