summary refs log tree commit diff stats
path: root/lib/binding.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-01-16 18:02:50 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-01-16 18:02:50 -0500
commit6746da6edd7d9d50efe374eabbb79a3cac882d81 (patch)
treeff20917e08b08d36b9541c1371106596e7bec442 /lib/binding.h
parent4af7e55733098ca42f75a4ffaca1b0f6bab4dd36 (diff)
downloadverbly-6746da6edd7d9d50efe374eabbb79a3cac882d81.tar.gz
verbly-6746da6edd7d9d50efe374eabbb79a3cac882d81.tar.bz2
verbly-6746da6edd7d9d50efe374eabbb79a3cac882d81.zip
Started structural rewrite
The new object structure was designed to build on the existing WordNet
structure, while also adding in all of the data that we get from other sources.
More information about this can be found on the project wiki.

The generator has already been completely rewritten to generate a
datafile that uses the new structure. In addition, a number of indexes
are created, which does double the size of the datafile, but also allows
for much faster lookups. Finally, the new generator is written modularly
and is a lot more readable than the old one.

The verbly interface to the new object structure has mostly been
completed, but has not been tested fully. There is a completely new
search API which utilizes a lot of operator overloading; documentation
on how to use it should go up at some point.

Token processing and verb frames are currently unimplemented. Source for
these have been left in the repository for now.
Diffstat (limited to 'lib/binding.h')
-rw-r--r--lib/binding.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/lib/binding.h b/lib/binding.h new file mode 100644 index 0000000..7fbe20e --- /dev/null +++ b/lib/binding.h
@@ -0,0 +1,70 @@
1#ifndef BINDING_H_CAE0B18E
2#define BINDING_H_CAE0B18E
3
4#include <string>
5
6namespace verbly {
7
8 class binding {
9 public:
10 enum class type {
11 invalid,
12 integer,
13 string
14 };
15
16 // Default constructor
17
18 binding()
19 {
20 }
21
22 // Copy and move constructors
23
24 binding(const binding& other);
25 binding(binding&& other);
26
27 // Assignment
28
29 binding& operator=(binding other);
30
31 // Swap
32
33 friend void swap(binding& first, binding& second);
34
35 // Destructor
36
37 ~binding();
38
39 // Generic accessors
40
41 type getType() const
42 {
43 return type_;
44 }
45
46 // Integer
47
48 binding(int arg);
49
50 int getInteger() const;
51
52 // String
53
54 binding(std::string arg);
55
56 std::string getString() const;
57
58 private:
59
60 union {
61 int integer_;
62 std::string string_;
63 };
64
65 type type_ = type::invalid;
66 };
67
68};
69
70#endif /* end of include guard: BINDING_H_CAE0B18E */