Package opennlp.ccg.hylo

Examples of opennlp.ccg.hylo.LexDependency


            ArrayList<String>rels=new ArrayList<String>(2);
            rels.add("First");rels.add("Next");
            Hashtable<LexDependency,Sign>cdeps=this.getLowerSiblingDeps(inputs,dep.lexDep,rels,null);
            if(cdeps!=null){
              for(Enumeration<LexDependency>e=cdeps.keys();e.hasMoreElements();){
                LexDependency cdep=e.nextElement();
                this.depSign=cdep.lexDep;
                inc(agrConjExtractors);
              }
            }
          }
         
          //Of-complement subjects (for non-numeral, non-%-sign subjs)
          String subjClass=dep.lexDep.getWords().get(0).getSemClass();
          String subjPOS=dep.lexDep.getPOS();
          if(subjClass==null)subjClass="NULL";
          if(!subjClass.equals("PERCENT") && !subjPOS.startsWith("CD")){
            ArrayList<String>rels=new ArrayList<String>(1);
            rels.add("Mod");
            ArrayList<String>depPreds=new ArrayList<String>(1);
            depPreds.add("of");
            Hashtable<LexDependency,Sign>ofComplDeps=this.getLowerSiblingDeps(inputs,dep.lexDep,rels,depPreds);
            if(ofComplDeps!=null){
              for(Enumeration<LexDependency>e1=ofComplDeps.keys();e1.hasMoreElements();){
                LexDependency ofComplDep=e1.nextElement();
                Sign[] ofComplSigns=ofComplDeps.get(ofComplDep).getDerivationHistory().getInputs();
                rels=new ArrayList<String>(1);
                rels.add("Arg1");
                Hashtable<LexDependency,Sign>ofDeps=this.getLowerSiblingDeps(ofComplSigns,ofComplDep.lexDep,rels,null);
                if(ofDeps!=null){
                  for(Enumeration<LexDependency>e2=ofDeps.keys();e2.hasMoreElements();){
                    LexDependency ofDep=e2.nextElement();
                    this.depSign=ofDep.lexDep;
                    inc(agrOfComplementExtractors);
                  }
                }
              }
            }
          }
         
        }
       
        //Relative clause features
        String whPrn=dep.lexDep.getOrthography();
        if((dep.rel.equals("GenRel")||dep.rel.equals("whApposRel")) && (whPrn.equals("that")||whPrn.equals("who")||whPrn.equals("which")||whPrn.equals("whose"))){
         
          //Make sure relative clause is linked to head of the quoted NP
          //(and not the quotation mark itself)
          Sign sib=this.getSibling(sign.getSiblingFilledDeps(),"Arg");
          if(sib!=null){
            this.headSign=sib;
          }
         
          //Simple WH-pronoun features
          //Increment instance number if in error analysis mode
          if(sentId!=null)INSTANCENUM++;
          inc(whExtractors);

          //Proximal conjunct features
          if(dep.lexDep.getPOS().equals("CC") || dep.lexDep.getOrthography().equals(",") || dep.lexDep.getOrthography().equals(";")|| dep.lexDep.getOrthography().equals("or")|| dep.lexDep.getOrthography().equals("and")){
            ArrayList<String>rels=new ArrayList<String>(1);
            rels.add("Next");
            Hashtable<LexDependency,Sign>cdeps=this.getLowerSiblingDeps(inputs,dep.lexDep,rels,null);
            if(cdeps!=null){
              for(Enumeration<LexDependency>e=cdeps.keys();e.hasMoreElements();){
                LexDependency cdep=e.nextElement();
                this.depSign=cdep.lexDep;
                inc(whConjExtractors);
              }
            }
          }
View Full Code Here

TOP

Related Classes of opennlp.ccg.hylo.LexDependency

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.