aboutsummaryrefslogtreecommitdiff
path: root/cmd/la-baujmi/README.md
blob: 10aa48df02e44cb9a3c9dcf27f39fadcee95587e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# la baujmi

Combination of:

> bangu
> 
> x1 is a/the language/dialect used by x2 to express/communicate x3 (si'o/du'u, not quote).

> jimpe
> 
> x1 understands/comprehends fact/truth x2 (du'u) about subject x3; x1 understands (fi) x3.

This is an attempt to create a tool that can understand language. 

At first, [Toki Pona](http://tokipona.net) will be used. At a high level a toki pona sentence consists of four main parts:

- context phrase
- subject + descriptors
- verb + descriptors
- object + descriptors

You can describe a sentence as a form of predicate relation between those four parts. If you are told "Stacy purchased a tool for strange-plant", you can later then ask the program who purchased a tool for strange-plant.

Because a Toki Pona sentence always matches the following form:

```
[<name> o,] [context la] <subject> [li <verb> [e <object>]]
```

And the particle `seme` fills in the part of a question that you don't know. So from this we can fill in the blanks with prolog.

Consider the following:

```
jan Kesi li toki.
Cadey is speaking
toki(jan_Kesi).

jan Kesi en jan Pola li toki.
Cadey and Pola are speaking.
toki(jan_Kesi).
toki(jan_Pola).

jan Kesi li toki e jan Pola.
Cadey is talking about Pola
toki(jan_Kesi, jan_Pola).

jan Kesi li toki e toki pona.
Cadey is talking about toki pona.
toki(jan_Kesi, toki_pona).

ilo Kesi o, toki e jan Kesi.
Robo-Cadey: talk about Cadey.
command(ilo_Kesi, toki(ziho, jan_Kesi)). % ziho -> nothing in lojban (zi'o)
```

And then we can ask prolog questions about this sentence:

```
seme li toki?
> toki(X).
toki(jan_Kesi).
jan Kesi li toki.
toki(jan_Pola).
jan Pola li toki.
```