Crates.io | nloq |
lib.rs | nloq |
version | 0.1.1 |
source | src |
created_at | 2020-09-08 15:07:49.111459 |
updated_at | 2020-09-22 15:18:49.006439 |
description | Natural Language Object Query |
homepage | https://github.com/riddleandcode/nlsd |
repository | https://github.com/riddleandcode/nlsd |
max_upload_size | |
id | 286163 |
size | 17,399 |
The goal of the Natural Object Query Language (or NOQL) is to have an plain old English representation of an object query
type QueryList<'a> = Vec<Query<'a>>;
enum Query<'a> {
Index {
index: usize,
from_end: bool
},
Key(&'a str)
}
where an object can take a list of query segments and either index a list or get a key from a map
the ((first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|eleventh|twelfth|#st|#nd|#rd|#th) [to last]|last) item
where #
is a positive integer
the [key|`key`|`multi word key`]
handlers of the key can choose to "dehumanize" the key however they want
(index|key) [of (index|key) [of (index|key) ...]]
query segments are chained with of