nloq

Crates.ionloq
lib.rsnloq
version0.1.1
sourcesrc
created_at2020-09-08 15:07:49.111459
updated_at2020-09-22 15:18:49.006439
descriptionNatural Language Object Query
homepagehttps://github.com/riddleandcode/nlsd
repositoryhttps://github.com/riddleandcode/nlsd
max_upload_size
id286163
size17,399
Julian Popescu (jpopesculian)

documentation

https://docs.rs/nloq/

README

Natural Object Query Language

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

Index

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

Key

the [key|`key`|`multi word key`]

handlers of the key can choose to "dehumanize" the key however they want

Query List

(index|key) [of (index|key) [of (index|key) ...]]

query segments are chained with of

Commit count: 59

cargo fmt