I often need to write relations whose structure is roughly similar. Now I'm using Auto-Hot key to expand some text abbreviations (I write in editbox of a Delphi program), but it would be better to have a language to describe a kind of "decisional tree" (with conditional branches, choices [radio box, check box, "if" structure,...) to obtain a final text according user decisions.
e.g. in a medical context (in UPPER CASE the resulting text):
Does shoulder ache ? No, Yes (radio-button) [No] -> NO SYMPTOMS ABOUT SHOULDER [Yes] -> Can rise arm against resistance ? (radio button) [No] -> STRONG SHOULDER PAIN WITH LOSS OF FUNCTIONALITY. [Yes] -> SHOULDER PAIN, BUT ABLE TO RISE OBJECTS.
This is only a small example: I'd like to create more complex decisional tree (e.g. about different body parts) ....
Does already exist a similar descriptive language text-oriented or have I to create it ? (I know Delphi and I could learn Python, but I have no much time).
Thanks for any advice!
Simon _______________________________________________________
Sperm: To be fastest doesn't imply that you are smartest. ( by Enrique Herranz )
On 2007-09-07, Simone Murdock <FalselinKsimonemurd...@vene.ws> wrote:
> I often need to write relations whose structure is roughly similar. > Now I'm using Auto-Hot key to expand some text abbreviations (I write in > editbox of a Delphi program), but it would be better to have a language > to describe a kind of "decisional tree" (with conditional branches, > choices [radio box, check box, "if" structure,...) to obtain a final > text according user decisions.
> e.g. in a medical context (in UPPER CASE the resulting text):
> Does shoulder ache ? No, Yes (radio-button) > [No] -> NO SYMPTOMS ABOUT SHOULDER > [Yes] -> Can rise arm against resistance ? (radio button) > [No] -> STRONG SHOULDER PAIN WITH LOSS OF FUNCTIONALITY. > [Yes] -> SHOULDER PAIN, BUT ABLE TO RISE OBJECTS.
Easier to do it like this:
1: Does shoulder ache ? [No] -> NO SYMPTOMS ABOUT SHOULDER [Yes] -> [2]
2: Can rise arm against resistance ? [No] -> STRONG SHOULDER PAIN WITH LOSS OF FUNCTIONALITY. [Yes] -> SHOULDER PAIN, BUT ABLE TO RISE OBJECTS.
In other words, the number is a label, you start with label 1, and if you have to go to another label you simply add the
- Put this in a textfile, and have a delphi app read it line for line. - if the line starts with a label, read two extra lines (yes and no), store them in an object and put them in a tstringlist with the label as string (iow strl.addobject(labelname,myobject); ) - skip empty lines.
The GUI will like this: Have a combo box, or a few buttons. As said we assume label 1 is the start, do a ind:=strl.indexof('1') and get the corresponding object (myobj:=TMyObjecType(strl.objects[ind]); ).
Now update the gui with the data in the classe. When a user selects something with an end choice, simply show the text, otherwise determine the number of the next label, and do the next iteration.