/** Same as semgrexFromGraph except the node traversal is ordered by sorting */ public static String semgrexFromGraphOrderedNodes(SemanticGraph sg, Collection<IndexedWord> wildcardNodes, Map<IndexedWord, String> nodeNameMap, Function<IndexedWord, String> wordTransformation) { IndexedWord patternRoot = sg.getFirstRoot(); StringWriter buf = new StringWriter(); Set<IndexedWord> tabu = Generics.newHashSet(); Set<SemanticGraphEdge> seenEdges = Generics.newHashSet(); buf.append(semgrexFromGraphHelper(patternRoot, sg, tabu, seenEdges, true, true, wildcardNodes, nodeNameMap, true, wordTransformation)); String patternString = buf.toString(); return patternString; }
/** * nodeValuesTranformation is a function that converts a vertex (IndexedWord) to the value. * For an example, see {@code semgrexFromGraph} * function implementations (if useWord and useTag is true, the value is "{word: vertex.word; tag: vertex.tag}"). * @throws Exception */ public static String semgrexFromGraph(SemanticGraph sg, Collection<IndexedWord> wildcardNodes, Map<IndexedWord, String> nodeNameMap, Function<IndexedWord, String> wordTransformation) { IndexedWord patternRoot = sg.getFirstRoot(); StringWriter buf = new StringWriter(); Set<IndexedWord> tabu = Generics.newHashSet(); Set<SemanticGraphEdge> seenEdges = Generics.newHashSet(); buf.append(semgrexFromGraphHelper(patternRoot, sg, tabu, seenEdges, true, true, wildcardNodes, nodeNameMap, false, wordTransformation)); String patternString = buf.toString(); return patternString; }
buf.append(semgrexFromGraphHelper(tgtVert, sg, tabu, seenEdges, useWordAsLabel, nameEdges, wildcardNodes, nodeNameMap, orderedNodes, nodeValuesTransformation)); if (applyParens)
/** Same as semgrexFromGraph except the node traversal is ordered by sorting */ public static String semgrexFromGraphOrderedNodes(SemanticGraph sg, Collection<IndexedWord> wildcardNodes, Map<IndexedWord, String> nodeNameMap, Function<IndexedWord, String> wordTransformation) { IndexedWord patternRoot = sg.getFirstRoot(); StringWriter buf = new StringWriter(); Set<IndexedWord> tabu = Generics.newHashSet(); Set<SemanticGraphEdge> seenEdges = Generics.newHashSet(); buf.append(semgrexFromGraphHelper(patternRoot, sg, tabu, seenEdges, true, true, wildcardNodes, nodeNameMap, true, wordTransformation)); String patternString = buf.toString(); return patternString; }
/** Same as semgrexFromGraph except the node traversal is ordered by sorting */ public static String semgrexFromGraphOrderedNodes(SemanticGraph sg, Collection<IndexedWord> wildcardNodes, Map<IndexedWord, String> nodeNameMap, Function<IndexedWord, String> wordTransformation) { IndexedWord patternRoot = sg.getFirstRoot(); StringWriter buf = new StringWriter(); Set<IndexedWord> tabu = Generics.newHashSet(); Set<SemanticGraphEdge> seenEdges = Generics.newHashSet(); buf.append(semgrexFromGraphHelper(patternRoot, sg, tabu, seenEdges, true, true, wildcardNodes, nodeNameMap, true, wordTransformation)); String patternString = buf.toString(); return patternString; }
/** * nodeValuesTranformation is a function that converts a vertex (IndexedWord) to the value. * For an example, see {@code semgrexFromGraph} * function implementations (if useWord and useTag is true, the value is "{word: vertex.word; tag: vertex.tag}"). * @throws Exception */ public static String semgrexFromGraph(SemanticGraph sg, Collection<IndexedWord> wildcardNodes, Map<IndexedWord, String> nodeNameMap, Function<IndexedWord, String> wordTransformation) { IndexedWord patternRoot = sg.getFirstRoot(); StringWriter buf = new StringWriter(); Set<IndexedWord> tabu = Generics.newHashSet(); Set<SemanticGraphEdge> seenEdges = Generics.newHashSet(); buf.append(semgrexFromGraphHelper(patternRoot, sg, tabu, seenEdges, true, true, wildcardNodes, nodeNameMap, false, wordTransformation)); String patternString = buf.toString(); return patternString; }
/** * nodeValuesTranformation is a function that converts a vertex (IndexedWord) to the value. * For an example, see {@code semgrexFromGraph} * function implementations (if useWord and useTag is true, the value is "{word: vertex.word; tag: vertex.tag}"). * @throws Exception */ public static String semgrexFromGraph(SemanticGraph sg, Collection<IndexedWord> wildcardNodes, Map<IndexedWord, String> nodeNameMap, Function<IndexedWord, String> wordTransformation) { IndexedWord patternRoot = sg.getFirstRoot(); StringWriter buf = new StringWriter(); Set<IndexedWord> tabu = Generics.newHashSet(); Set<SemanticGraphEdge> seenEdges = Generics.newHashSet(); buf.append(semgrexFromGraphHelper(patternRoot, sg, tabu, seenEdges, true, true, wildcardNodes, nodeNameMap, false, wordTransformation)); String patternString = buf.toString(); return patternString; }
buf.append(semgrexFromGraphHelper(tgtVert, sg, tabu, seenEdges, useWordAsLabel, nameEdges, wildcardNodes, nodeNameMap, orderedNodes, nodeValuesTransformation)); if (applyParens)
buf.append(semgrexFromGraphHelper(tgtVert, sg, tabu, seenEdges, useWordAsLabel, nameEdges, wildcardNodes, nodeNameMap, orderedNodes, nodeValuesTransformation)); if (applyParens)