Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
HowToKB/src/test/kb/howtokb/WikiHowArticleReaderTest.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
31 lines (22 sloc)
923 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test.kb.howtokb; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import org.json.simple.parser.ParseException; | |
import kb.howtokb.reader.WikiHowArticleReader; | |
import kb.howtokb.wkhobject.Question; | |
public class WikiHowArticleReaderTest { | |
public static void main(String[] args) throws ClassNotFoundException, IOException, ParseException { | |
String input = "howtokb-data/wikihow-data-all.json"; | |
ArrayList<Question> allques = WikiHowArticleReader.WikiHowArticleReaderFromJSONFile(input); | |
int i=0; | |
for (Question q: allques){ | |
System.out.println(q.toString()); | |
if (i++ == 5) break; | |
} | |
System.out.println("Total of questions: " + allques.size()); | |
// //Test activity extraction | |
// String sent = "You have to buy a new pass for the following day."; | |
// TextToWikiHowTaskFrame test = new TextToWikiHowTaskFrame(); | |
// System.out.println(test.sentToListWikiHowTaskFrame(sent)); | |
} | |
} |