public class CommonCNFUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CommonCNFUtil.Pair<F,S> |
static class |
CommonCNFUtil.QAPair
DTO class for json input and output
|
| Modifier and Type | Method and Description |
|---|---|
static CNF |
findOneCommonCNF(Collection<CNF> input) |
static void |
findPath(String cnfStr,
String s1,
String s2)
find all the paths between two literals
|
static Map<Integer,CNF> |
generateCNFForStringSet(Map<Integer,String> sentences) |
static List<CommonCNFUtil.QAPair> |
loadCNFMapfromFile(String path)
load the intermediate parsing result to save time
|
static CNF |
loadFileAndFindCommonCNF(String path)
function to load text file and generate one common CNF for all sentences,
one sentence one line.
|
static List<CommonCNFUtil.QAPair> |
loadSentencesFormJsonFile(String path)
load sentences from "IRtest.json" like QA pair file
|
static String[] |
loadSentencesFromTxt(String path)
load sentences from file, one line one sentence
|
static Map<Integer,String> |
loadSentencesMap(String path)
load sentences from file, one line one sentence
return map
|
static void |
main(String[] args) |
static String |
saveCNFMaptoFile(List<CommonCNFUtil.QAPair> list,
String path)
save the intermediate parsing result to JSON file
|
public static String saveCNFMaptoFile(List<CommonCNFUtil.QAPair> list, String path)
public static List<CommonCNFUtil.QAPair> loadCNFMapfromFile(String path)
public static String[] loadSentencesFromTxt(String path)
public static Map<Integer,String> loadSentencesMap(String path)
public static List<CommonCNFUtil.QAPair> loadSentencesFormJsonFile(String path)
public static Map<Integer,CNF> generateCNFForStringSet(Map<Integer,String> sentences) throws IOException
IOExceptionpublic static CNF findOneCommonCNF(Collection<CNF> input)
public static CNF loadFileAndFindCommonCNF(String path) throws IOException
IOExceptionpublic static void findPath(String cnfStr, String s1, String s2)
public static void main(String[] args)
Copyright © 2015. All rights reserved.