From 705cc377ea31b5f310b8f970524825889d306523 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Mon, 18 May 2020 07:53:10 -0400 Subject: [PATCH] add wordlist to generated images --- .drone.yml | 4 +- book/default.nix | 5 + book/src/03_nouns_verbs/index.md | 2 +- book/src/SUMMARY.md | 1 + book/src/build.sh | 2 + book/src/dictionary.md | 279 +++++++++++++++++++++++++++++ nix/sources.json | 12 ++ words/Prelude.dhall | 1 + words/default.nix | 23 +++ words/dictionary.dhall | 63 ++++--- words/utils/showDictionary.dhall | 30 ++++ words/utils/showParticleWord.dhall | 16 ++ 12 files changed, 402 insertions(+), 36 deletions(-) create mode 100644 book/src/dictionary.md create mode 100644 words/Prelude.dhall create mode 100644 words/default.nix create mode 100644 words/utils/showDictionary.dhall create mode 100644 words/utils/showParticleWord.dhall diff --git a/.drone.yml b/.drone.yml index 38797fb..cc32e0b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -65,6 +65,4 @@ steps: image: "monacoremo/nix:2020-04-05-05f09348-circleci" pull: always commands: - - nix-env -if ./nix/dhall.nix - - cd words - - dhall --file ./dictionary.dhall + - nix-build ./words diff --git a/book/default.nix b/book/default.nix index 18ca302..92ca249 100644 --- a/book/default.nix +++ b/book/default.nix @@ -7,6 +7,7 @@ let }; tex = pkgs.callPackage ../nix/texlive.nix { }; version = "devel"; + words = import ../words; book = pkgs.stdenv.mkDerivation { pname = "lewa-book"; inherit version; @@ -17,12 +18,16 @@ let mdbook nur.repos.mic92.pandoc-bin tex + words ]; buildPhase = '' cp -rf $src/src . + chmod a+w ./src cp -rf $src/book.toml . mkdir book + rm ./src/dictionary.md ||: + cp ${words}/dictionary.md ./src/dictionary.md mdbook build cd ./src && ./build.sh && cd .. cd ./book && kindlegen lewa.epub ||: && cd .. diff --git a/book/src/03_nouns_verbs/index.md b/book/src/03_nouns_verbs/index.md index 9a9f160..a465af6 100644 --- a/book/src/03_nouns_verbs/index.md +++ b/book/src/03_nouns_verbs/index.md @@ -76,7 +76,7 @@ marked with particles. Here's a table of the common ones: | ---------- | ----- | | past tense | qu | | present tense | qa | -| future tense | qi | +| future tense | qo | | perfective aspect | qe | ## Modality diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index f71c3b4..6b6c730 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -9,3 +9,4 @@ - [Word Order](./02_typology/word_order.md) - [Morphological Typology](./02_typology/typology.md) - [Fun with Nouns and Verbs](./03_nouns_verbs/index.md) +- [Dictionary](./dictionary.md) diff --git a/book/src/build.sh b/book/src/build.sh index e285cae..9c61046 100755 --- a/book/src/build.sh +++ b/book/src/build.sh @@ -14,6 +14,8 @@ intro/index.md 02_typology/typology.md 03_nouns_verbs/index.md + +dictionary.md ' set -x diff --git a/book/src/dictionary.md b/book/src/dictionary.md new file mode 100644 index 0000000..b83c909 --- /dev/null +++ b/book/src/dictionary.md @@ -0,0 +1,279 @@ +# Dictionary + +This chapter of the book will hold a list of all of the words in L'ewa as the time of this book being rendered. This may not be the most up-to-date list of words. See (TODO(Mai): ko finti le vlaste kibystu) for more words. + +## Root Words + +### l'ewa + +*language* + +is a language + +### madsa + +*eat* + +eats/is eating/to eat + +### qa'te + +*fast* + +is fast/rapid in rate + +### spalo + +*apple* + +is an apple + +### zasko + +*plant* + +is a plant/is vegetation + + +## Particles + +### mi + +family: MI + +*me, I* + +the current speaker + +### mi'a + +family: MI + +*we (system)* + +the system of the current speaker, inclusive + +### mi'o + +family: MI + +*we (all)* + +any speaker, any listener and any others + +### ro + +family: MI + +*you* + +the listener + +### ro'a + +family: MI + +*you (+ system)* + +the system of the listener + +### ti + +family: TI + +*this* + +the currently referenced object near the speaker + +### ta + +family: TI + +*that* + +that (near listener) + +### tu + +family: TI + +*that* + +that (far away) + +### ka + +family: KA + +*subject marker* + +explicitly marks noun-phrase as the subject of the verb + +### ke + +family: KA + +*verb marker* + +explicitly marks following phrase as a verb + +### ku + +family: KA + +*object marker* + +explicitly marks following phrase as the object of the verb + +### lo + +family: LO + +*a/an* + +indefinite article + +### le + +family: LO + +*the* + +definite article + +### zo + +family: JA + +*zero* + +zero + +### ja + +family: JA + +*one* + +one + +### he + +family: JA + +*two* + +two + +### xu + +family: JA + +*three* + +three + +### ho + +family: JA + +*four* + +four + +### qi + +family: JA + +*five* + +five + +### gau + +family: JA + +*nif* + +nif (dec 36) + +### to + +family: JA + +*all* + +all/every + +### ra'o + +family: JA + +*some* + +some amount of/a few + +### so + +family: JA + +*how many?* + +how many/number question + +### na + +family: NA + +*total negation* + +something other than, total negation + +### na'o + +family: NA + +*scalar negation* + +the opposite of + +### nai + +family: NA + +*particle negation* + +negation of a particular particle + +### qu + +family: QA + +*past tense* + +marks noun phrase / verb as past tense + +### qa + +family: QA + +*present tense* + +marks noun phrase / verb as present tense + +### qo + +family: QA + +*future tense* + +marks noun phrase / verb as future tense + +### qe + +family: QA + +*perfective aspect* + +marks noun phrase / verb as perfective, or completed + diff --git a/nix/sources.json b/nix/sources.json index 5954f22..4657c50 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -1,4 +1,16 @@ { + "dhall-lang": { + "branch": "master", + "description": "Maintainable configuration files", + "homepage": "https://dhall-lang.org", + "owner": "dhall-lang", + "repo": "dhall-lang", + "rev": "078df280e99b2b7385c70e1ecadb52331d6040ce", + "sha256": "1h4cj37rbdyfcw40wwnn4xyvf624gb9163mcw1zaxkkagx80dksq", + "type": "tarball", + "url": "https://github.com/dhall-lang/dhall-lang/archive/078df280e99b2b7385c70e1ecadb52331d6040ce.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "easy-dhall-nix": { "branch": "master", "description": "Derivations for easily downloading Dhall binaries and putting them to use.", diff --git a/words/Prelude.dhall b/words/Prelude.dhall new file mode 100644 index 0000000..9d14d27 --- /dev/null +++ b/words/Prelude.dhall @@ -0,0 +1 @@ +env:DHALL_PRELUDE ? https://prelude.dhall-lang.org/package.dhall diff --git a/words/default.nix b/words/default.nix new file mode 100644 index 0000000..78c91ff --- /dev/null +++ b/words/default.nix @@ -0,0 +1,23 @@ +let + sources = import ../nix/sources.nix; + pkgs = import sources.nixpkgs { }; + dhall = pkgs.callPackage ../nix/dhall.nix { }; +in pkgs.stdenv.mkDerivation { + name = "lewa-dictionary"; + src = ./.; + phases = "buildPhase installPhase"; + + buildInputs = [ sources.dhall-lang ]; + + DHALL_PRELUDE = "${sources.dhall-lang}/Prelude/package.dhall"; + + buildPhase = '' + env | grep ^DHALL + ${dhall}/bin/dhall text --file $src/utils/showDictionary.dhall > dictionary.md + ''; + + installPhase = '' + mkdir -p $out + cp dictionary.md $out/dictionary.md + ''; +} diff --git a/words/dictionary.dhall b/words/dictionary.dhall index 751b79c..932f054 100644 --- a/words/dictionary.dhall +++ b/words/dictionary.dhall @@ -10,36 +10,35 @@ in { rootWords = , ./roots/zasko.dhall ] , particles = - [ ./particles/mi.dhall - , ./particles/mi_a.dhall - , ./particles/mi_o.dhall - , ./particles/ro.dhall - , ./particles/ro_a.dhall - , ./particles/ti.dhall - , ./particles/ta.dhall - , ./particles/tu.dhall - , ./particles/ka.dhall - , ./particles/ke.dhall - , ./particles/ku.dhall - , ./particles/lo.dhall - , ./particles/le.dhall - , ./particles/zo.dhall - , ./particles/ja.dhall - , ./particles/he.dhall - , ./particles/xu.dhall - , ./particles/ho.dhall - , ./particles/qi.dhall - , ./particles/gau.dhall - , ./particles/to.dhall - , ./particles/ra_o.dhall - , ./particles/so.dhall - , ./particles/na.dhall - , ./particles/na_o.dhall - , ./particles/nai.dhall - , ./particles/qu.dhall - , ./particles/qa.dhall - , ./particles/qo.dhall - , ./particles/qe.dhall - ] - : List ParticleWord.Type + [ ./particles/mi.dhall + , ./particles/mi_a.dhall + , ./particles/mi_o.dhall + , ./particles/ro.dhall + , ./particles/ro_a.dhall + , ./particles/ti.dhall + , ./particles/ta.dhall + , ./particles/tu.dhall + , ./particles/ka.dhall + , ./particles/ke.dhall + , ./particles/ku.dhall + , ./particles/lo.dhall + , ./particles/le.dhall + , ./particles/zo.dhall + , ./particles/ja.dhall + , ./particles/he.dhall + , ./particles/xu.dhall + , ./particles/ho.dhall + , ./particles/qi.dhall + , ./particles/gau.dhall + , ./particles/to.dhall + , ./particles/ra_o.dhall + , ./particles/so.dhall + , ./particles/na.dhall + , ./particles/na_o.dhall + , ./particles/nai.dhall + , ./particles/qu.dhall + , ./particles/qa.dhall + , ./particles/qo.dhall + , ./particles/qe.dhall + ] } diff --git a/words/utils/showDictionary.dhall b/words/utils/showDictionary.dhall new file mode 100644 index 0000000..bea68f8 --- /dev/null +++ b/words/utils/showDictionary.dhall @@ -0,0 +1,30 @@ +let ContentWord = ../types/ContentWord.dhall + +let ParticleWord = ../types/ParticleWord.dhall + +let showContent = ./showContentWord.dhall + +let showParticle = ./showParticleWord.dhall + +let dictionary = ../dictionary.dhall + +let Prelude = ../Prelude.dhall + +let contentWords = Prelude.Text.concatMapSep "\n" ContentWord.Type showContent + +let particleWords = + Prelude.Text.concatMapSep "\n" ParticleWord.Type showParticle + +in '' + # Dictionary + + This chapter of the book will hold a list of all of the words in L'ewa as the time of this book being rendered. This may not be the most up-to-date list of words. See (TODO(Mai): ko finti le vlaste kibystu) for more words. + + ## Root Words + + ${contentWords dictionary.rootWords} + + ## Particles + + ${particleWords dictionary.particles} + '' diff --git a/words/utils/showParticleWord.dhall b/words/utils/showParticleWord.dhall new file mode 100644 index 0000000..38bd223 --- /dev/null +++ b/words/utils/showParticleWord.dhall @@ -0,0 +1,16 @@ +let ParticleWord = ../types/ParticleWord.dhall + +let render + : ParticleWord.Type → Text + = λ(word : ParticleWord.Type) → + '' + ### ${word.word} + + family: ${word.family} + + *${word.gloss}* + + ${word.definition} + '' + +in render