Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
I want to convert a plain natural language text to flow chart.How can I do this ?
Posted
Updated 22-Feb-14 1:42am
v2

1 solution

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
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900