| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2016-05-05 14:59:28 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2016-05-05 14:59:28 +0200 | 
| commit | 3405b0c1635843cbb81f042364bfcf238d7dc930 (patch) | |
| tree | 39501fec9ec72863c929a45dbc297412bbf90688 /src/core/knowledge.h | |
| parent | c28bb6d31a122ec983e1e0a0dd1a8bd198098c58 (diff) | |
Adds the current code.
It's been running for close to a month on one of the IRC channels I
frequent and seems to be working fine.
One should be aware that, among other missing features, this version
does not store permanently what the bot learns. Indeed, I am currently
using a file with 431848 lines as its initial knowledge bank, making
this particular feature not a high priority one.
Also consider the fact that Zero of One converts text to underscore
before reading it but will not change its own aliases. This could
potentially be a cause for surprises when using uppercase letters in the
latter.
Diffstat (limited to 'src/core/knowledge.h')
| -rw-r--r-- | src/core/knowledge.h | 42 | 
1 files changed, 42 insertions, 0 deletions
| diff --git a/src/core/knowledge.h b/src/core/knowledge.h new file mode 100644 index 0000000..f20cb16 --- /dev/null +++ b/src/core/knowledge.h @@ -0,0 +1,42 @@ +#ifndef _ZoO_CORE_KNOWLEDGE_H_ +#define _ZoO_CORE_KNOWLEDGE_H_ + +#include "../tool/strings_types.h" + +#include "knowledge_types.h" + +int ZoO_knowledge_initialize (struct ZoO_knowledge k [const static 1]); + +void ZoO_knowledge_finalize (struct ZoO_knowledge k [const static 1]); + +int ZoO_knowledge_find +( +   const struct ZoO_knowledge k [const restrict static 1], +   const ZoO_char word [const restrict static 1], +   ZoO_index result [const restrict static 1] +); + +int ZoO_knowledge_learn +( +   struct ZoO_knowledge k [const static 1], +   const ZoO_char word [const restrict static 1], +   ZoO_index result [const restrict static 1] +); + +int ZoO_knowledge_assimilate +( +   struct ZoO_knowledge k [const static 1], +   struct ZoO_strings string [const restrict static 1], +   ZoO_index const aliases_count, +   const char * restrict aliases [const restrict static aliases_count] +); + +int ZoO_knowledge_extend +( +   struct ZoO_knowledge k [const static 1], +   const struct ZoO_strings string [const static 1], +   int const ignore_first_word, +   ZoO_char * result [const static 1] +); + +#endif | 


