sbenthall / bluestocking

A bookish botscript eager to provide her considerate opinion
GNU General Public License v3.0
14 stars 3 forks source link

introduct Concept class (and subclasses?) #6

Open sbenthall opened 12 years ago

sbenthall commented 12 years ago

Introduce Concept class as wrapper around a semantic node. A Concept has:

sbenthall commented 12 years ago

With this, there are new performance reasons for using this: https://github.com/sbenthall/bluestocking/commit/8b9abdfdaa43008ca0a784b559bbdd0d0d64f7e3

We can achieve O(1) time checking a relation against a knowledge base. This is necessary for large knowledge bases. But when testing for relation equality means testing for synonyms or antonyms, that means we can't hash on strings for the internal data structure of Doxaments.

So, Concepts need to be hashable, and their antonym Concepts (consistently hashed) need to be hashable as well.

This could lead to problems, as right now (because we aggregate lemmas across many word senses), it's is not the case that if anto(x,y) then anto(y,x). Hmm

sbenthall commented 12 years ago

See

https://github.com/sbenthall/bluestocking/commit/bc63dd641699ff6e91ca6d85206f1dfb67b66594

for performance improvements without implementing the Concept class. Could probably squeak by without this functionality to get a 0.1 out sooner.

sbenthall commented 12 years ago

Bumping to 2.0, may need to be nixed as we redesign parsing and doxament structure.