Package edu.stanford.nlp.dcoref

Examples of edu.stanford.nlp.dcoref.CoNLL2011DocumentReader$Document


    if(!sense.equals(sense2))
    {
      qry+="+AND+"+"\""+sense2.getSid()+"\"";
    }
    URL count=new URL(this.path+"/w/index.php?title=Special%3ASearch&profile=default&search="+qry+"&fulltext=Search");   
    Document xml=this.loadURL(count)
    if(xml!=null)
    {
      String aux="mw-search-formheader";
      for(Element e:this.getContentNode(xml).getDescendants(new ElementFilter("div")))
      {
View Full Code Here


        System.out.println("-----------Checking file: "+file.getName()+ " "+String.valueOf(x)+"/"+String.valueOf(files.size())+"--------------");
        x++;
        try
        {
          SAXBuilder builder=new SAXBuilder();
          Document xml=(Document)builder.build(file);
          ArrayList<Element> words=new ArrayList<Element>();
          for(Element word:xml.getDescendants(new ElementFilter("wf")))
            words.add(word);
          for(int w=0;w<words.size();w++)
          {
            Element word=words.get(w);
            if(word.getAttribute("ot")!=null)
View Full Code Here

     * @throws IOException
     */
    private Element htmlStringToElement( String html ) throws JDOMException, IOException
    {
        SAXBuilder builder = new SAXBuilder( CYBERNEKO_PARSER, true );
        Document doc = builder.build( new StringReader( html ) );
        Element element = doc.getRootElement();
        return element;
    }
View Full Code Here

     @param element The element to get HTML from.
     *  @return HTML
     */
    public static String element2String( Element element )
    {
        Document document = new Document( element );
        XMLOutputter outputter = new XMLOutputter();
        return outputter.outputString( document );
    }
View Full Code Here

        Enumeration< URL > resources = XmlUtil.class.getClassLoader().getResources( xml );
        while( resources.hasMoreElements() ) {
                  URL resource = resources.nextElement();
                 
                  log.debug( "reading " + resource.toString() );
                  Document doc = builder.build( resource );
                  XPathFactory xpfac = XPathFactory.instance();
                  XPathExpression< Element > xp = xpfac.compile( requestedNodes, Filters.element() );
                  readed.addAll( xp.evaluate( doc ) ); // filter out repeated items
              }
        return new ArrayList< Element >( readed );
View Full Code Here

   */
  public static List< Element > parse( InputStream xmlStream, String requestedNodes ) {
    if( xmlStream != null && StringUtils.isNotEmpty( requestedNodes ) ) {
      SAXBuilder builder = new SAXBuilder();
      try {
                Document doc = builder.build( xmlStream );
                XPathFactory xpfac = XPathFactory.instance();
                XPathExpression< Element > xp = xpfac.compile( requestedNodes, Filters.element() );
               
        return xp.evaluate( doc );
      } catch ( IOException ioe ) {
View Full Code Here

    {
        URL url;
        SAXBuilder builder = new SAXBuilder();
        builder.setValidation( false );
        builder.setEntityResolver( new LocalEntityResolver() );
        Document doc = null;
        if ( m_engine.getServletContext() == null )
        {
            ClassLoader cl = WebContainerAuthorizer.class.getClassLoader();
            url = cl.getResource( "WEB-INF/web.xml" );
            if( url != null )
View Full Code Here

          String versionOverride = System.getProperty("version.override");
            if (versionOverride != null) {
                getLog().info("changing version of pom file and save it to target/pom.xml");
                SAXBuilder builder = new SAXBuilder();
                Document doc = builder.build(pomFile);
                Element versionElem = findElement(doc.getRootElement().getChildren(), "version");
                if (versionElem == null) {
                 
                  //version inherited from parent, so get it from there
                  Element parentElem = findElement(doc.getRootElement().getChildren(), "parent");
                  versionElem = findElement(parentElem.getChildren(), "version");
                }
               
                versionElem.setText(versionOverride);
                File targetDir = new File(pomFile.getParent() + "/target");
View Full Code Here

  /**
   * Método responsável pelo carregamento do arquivo .cody.
   * @return  Retorna a tag root do documento carregado.
   */
  public Element importarArquivoXML(){
    Document doc = null;
        SAXBuilder builder = new SAXBuilder();
        try {

              doc = builder.build(path);

        } catch (Exception e) {
         
              e.printStackTrace();

        }
        Element raiz = doc.getRootElement();
        return raiz;
       
  }
View Full Code Here

     */
  public boolean exportarArquivo(String path){ 
    config.setNovaMensagemNoLog("exportarArquivo: "+path);
    this.setArquivoAberto(path);
   
    Document doc;
    doc = instituicao.getInstituicaoXML();
   
    Arquivo SalvarArquivo = new Arquivo(path);
    return SalvarArquivo.exportarArquivoXML(doc);
  }
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.dcoref.CoNLL2011DocumentReader$Document

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.