将纯自然语言文本转换为流程图 [英] Convert a plain natural language text to flow chart

查看:512
本文介绍了将纯自然语言文本转换为流程图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将简单的自然语言文本转换为流程图。我该怎么做?

解决方案

你的标签Python和Java非常不错。告诉我,我可以自由地使用一些方便的伪代码来定义合适的算法,从而节省大量的时间。算法本身可以相当简单。这样的事情:

 addFlowChart(输入:字符串;图表:FlowChart): -  
words:string []:= parseStringIntoWords(input);
节点:FlowChartNode:= chart.current;单词中每个单词

current.next:= new FlowChartNode;
current.next.text:= word;
current:= current.next;
...



此算法将创建一个没有任何分支的流程图节点链,因此没有任何循环。它将在节点之间实现以下关系:对于每个有序的节点对 A,B ,它定义节点中的字段 B 跟随输入文本输入中的 A 。您不能否认这是输入文本输入 c> 生成的工作流程之一



你会说什么?不重要的?没用?



不太好。在某种程度上,我的解决方案非常有用,如果有几种不同的方式。



首先,它应该证明你的问题是多么无用。

它应该帮助你开始思考以下概念:什么是定义,问题,问题的形成和规范?

它应该帮助你理解逻辑推理。

它应该帮助你开始思考以下问题:如何以有用和建设性的方式提出问题。

此外,如果应该帮助你帮助你挑选适合你的技能水平的问题知识。



我希望它真的能帮到你。



-SA

I want to convert a plain natural language text to flow chart.How can I do this ?

解决方案

Your tags "Python" and "Java" are very nice. The tell me that I can freely use some convenient pseudo-code for definition of the suitable algorithm and thus saver good deal of time. The algorithm itself can be fairly simple. Something like this:

addFlowChart(input: string; chart: FlowChart) :-
    words: string[] := parseStringIntoWords(input);
    node: FlowChartNode := chart.current;
    for each word in words:
        current.next := new FlowChartNode;
        current.next.text := word;
        current := current.next;
        ...


This algorithm will create a chain of flow chart nodes without any forks and hence without any loops. It will implement the following relationships between nodes: for each ordered pair of nodes A, B, it defines if the word field in the node B follows that of A in the input text input. You cannot deny the fact that this is one of the possible workflows generated by the input text input.

What will you say? Trivial? Useless?

Not quite. In a way, my solution is very useful, if several different ways.

First of all, it should demonstrate How Useless Your Question Is.
It should help you to start thinking at the following concepts: what is Definition, Problem, Formulation of a Problem and Specification?
It should help you to Understand Logical Reasoning.
It should help you to start thinking at the following problem: How to Ask Questions in a Useful and Constructive Way.
Also, if should help you to help Picking Problems Adequate to Your Level of Skills and Knowledge.

I hope it will really help you.

—SA


这篇关于将纯自然语言文本转换为流程图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆