本文整理汇总了Python中programy.parser.pattern.graph.PatternGraph.node_from_text方法的典型用法代码示例。如果您正苦于以下问题:Python PatternGraph.node_from_text方法的具体用法?Python PatternGraph.node_from_text怎么用?Python PatternGraph.node_from_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类programy.parser.pattern.graph.PatternGraph
的用法示例。
在下文中一共展示了PatternGraph.node_from_text方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_node_from_text_oneormore
# 需要导入模块: from programy.parser.pattern.graph import PatternGraph [as 别名]
# 或者: from programy.parser.pattern.graph.PatternGraph import node_from_text [as 别名]
def test_node_from_text_oneormore(self):
node = PatternGraph.node_from_text("_")
self.assertIsNotNone(node)
self.assertIsInstance(node, PatternOneOrMoreWildCardNode)
node = PatternGraph.node_from_text("*")
self.assertIsNotNone(node)
self.assertIsInstance(node, PatternOneOrMoreWildCardNode)
示例2: test_node_from_text_zeroormore
# 需要导入模块: from programy.parser.pattern.graph import PatternGraph [as 别名]
# 或者: from programy.parser.pattern.graph.PatternGraph import node_from_text [as 别名]
def test_node_from_text_zeroormore(self):
node = PatternGraph.node_from_text("^")
self.assertIsNotNone(node)
self.assertIsInstance(node, PatternZeroOrMoreWildCardNode)
node = PatternGraph.node_from_text("#")
self.assertIsNotNone(node)
self.assertIsInstance(node, PatternZeroOrMoreWildCardNode)
示例3: test_node_from_text_oneormore
# 需要导入模块: from programy.parser.pattern.graph import PatternGraph [as 别名]
# 或者: from programy.parser.pattern.graph.PatternGraph import node_from_text [as 别名]
def test_node_from_text_oneormore(self):
graph = PatternGraph(self._client_context.brain.aiml_parser)
node = graph.node_from_text("_")
self.assertIsNotNone(node)
self.assertIsInstance(node, PatternOneOrMoreWildCardNode)
node = graph.node_from_text("*")
self.assertIsNotNone(node)
self.assertIsInstance(node, PatternOneOrMoreWildCardNode)
示例4: test_node_from_text_word
# 需要导入模块: from programy.parser.pattern.graph import PatternGraph [as 别名]
# 或者: from programy.parser.pattern.graph.PatternGraph import node_from_text [as 别名]
def test_node_from_text_word(self):
node = PatternGraph.node_from_text("X")
self.assertIsNotNone(node)
self.assertIsInstance(node, PatternWordNode)
示例5: test_node_from_text_prioity
# 需要导入模块: from programy.parser.pattern.graph import PatternGraph [as 别名]
# 或者: from programy.parser.pattern.graph.PatternGraph import node_from_text [as 别名]
def test_node_from_text_prioity(self):
node = PatternGraph.node_from_text("$A")
self.assertIsNotNone(node)
self.assertIsInstance(node, PatternPriorityWordNode)
示例6: test_node_from_text_word
# 需要导入模块: from programy.parser.pattern.graph import PatternGraph [as 别名]
# 或者: from programy.parser.pattern.graph.PatternGraph import node_from_text [as 别名]
def test_node_from_text_word(self):
graph = PatternGraph(self._client_context.brain.aiml_parser)
node = graph.node_from_text("X")
self.assertIsNotNone(node)
self.assertIsInstance(node, PatternWordNode)