diff options
| author | Alon Levy <alon@pobox.com> | 2015-02-24 17:28:46 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-02-24 17:28:49 +0200 |
| commit | dd3760be123b8d91496e3216a8212f71d32b2a3f (patch) | |
| tree | 9151cf5209d17c79a3e66640ee7bc52f8e55ab74 /src/server-tests/test_db_controller.py | |
| parent | 6a9ed9a51476907d4510f06b66e4f7d8afd9c47c (diff) | |
client/textanalysis rewrite
I considered breaking this into multiple parts but it is too much work
and not worth it at this point.
Logically there are two parts: a bunch of support functions, most of
them are generic (list_* and obj_*, subsets) plus a few special
functions:
tokens_to_graph_elements and groups_to_thirds
"thirds" is a list of objects representing either a node or a link with start,
end and token. The token is the node/link name, the start and end are
used to later lookup the node based on cursor position (for type
changing from the command line).
groups is just an intermediate step where each individual token (space
separates them, except when in quotes) is still a separate entry in the
list.
The logic of textanalysis remains:
- prefix (text before the first node) means the first link is the
complete sentence
- starCase ramains (creating a single center node of the complete
sentence and linking everything to it with the 'chained' link name)
- and logic is updated to include multiple and sequences (the simple
case remains for a single stretch of ands).
Simplifications of the code:
- single place calls for __addNode and __addLink
- no more orderStack, instead we have a thirds array of node,link pairs
flattened to a single list, each with start/end in the sentence (this
takes into account the hash mark).
Diffstat (limited to 'src/server-tests/test_db_controller.py')
0 files changed, 0 insertions, 0 deletions
