Hello there
I am working in a part-of-speech "dialog" program that has to retrieve a specific value according with the recomposition of its key. My problem is that I have some many transition tables whose values are keys in other tables and so on, that I was wondering that maybe I am not structuring the solution right, Could you please give some advice on this?
Two original file; the first one has a series of lines with the dialog (questions/or answers) already tagged: What/WP is/VBZ her name/NP?. the second file has a series of complementary information: Maybe, Sure, Ohh, Oops, etc associate with each dialog in the first file
I extracted the tags from the original file, creating unique composed keys WP-VBZ-NP which I will match with the keys I have in a hash table (1), this hash table will retrieve a value X1, which is the "key" in another hash of arrays (2) that has as value an array {y1, y2, y3} of posibles answer/or question for that dialog. The values of the array are keys in another hash table (3), where the value are the recomposed key for the specific dialog in the first (original file): y1 ->(CI)-NP-VBZ
I hope this is no getting too long and complicated, well I am going crazy.
To finish, I take the value I got in the last table (3): (CI)-NP-VBZ (recomposed key), and going to the original file (array/or hash?) with the pair tag/value, and extract the values in the order the "recomposed key" suggest and also concatenate de value of the second file.
At the end the dialog goes like that:
What is her name?
Oops, her name is..
You don't know her name?!!
I don't know, maybe is..
So my question, the structure solution is ok? the number of transitions tables(hash or arrays) is ok? and the last one how do I extract the value for especific tag according with the recomposed key? Should I put each line (original tagged file) with the pairs tag/value in an array or another hash key->tag value->value?
Thanks in advances for your patience and any help!!!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.