Package it.cnr.isti.hpc.wikipedia.article

Examples of it.cnr.isti.hpc.wikipedia.article.Template


        .getTemplates()) {
      List<String> templateParameters = t.getParameters();
      parseTemplatesSchema(article, templateParameters);

      if (t.getName().toLowerCase().startsWith("infobox")) {
        article.setInfobox(new Template(t.getName(), templateParameters));
      } else {
        templates.add(new Template(t.getName(), templateParameters));
      }
    }
    article.setTemplates(templates);

  }
View Full Code Here


    String text = readFileAsString("/it/xml-dump/article-with-infobox.txt");
    articleParser.parse(articleWithInfobox, text);
   
    assertTrue(articleWithInfobox.hasInfobox());
    Template infobox = articleWithInfobox.getInfobox();
    assertEquals(12,infobox.getSchema().size());
    assertEquals("Infobox_fiume", infobox.getName());
    assertEquals("Adige", infobox.get("nome"));
    assertEquals("12200", infobox.get("bacino"));
   

  }
View Full Code Here

TOP

Related Classes of it.cnr.isti.hpc.wikipedia.article.Template

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.