Skip to content

Commit

Permalink
hdplisp-on-racket (#18): created ConiunctumLinguam & ConiunctumScriptum
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed Apr 17, 2021
1 parent ff498d9 commit b11a3bf
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 14 deletions.
38 changes: 24 additions & 14 deletions hdpl-conventions/prototype/hdpl/commune/constans.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

(require csv-reading)
(require data-frame)
(require hdpl/commune/structuram)

;; org.ocha.vocabulary->adm0
; https://docs.google.com/spreadsheets/d/1NjSI2LaS3SqbgYc0HdD8oIb7lofGtiHgoKKATCpwVdY/edit#gid=1088874596
Expand Down Expand Up @@ -44,22 +45,31 @@

;; TODO: maybe cache things like this https://docs.racket-lang.org/memo/index.html

(define CodicemLinguam (df-read/csv "ontologia/codicem/codicem.linguam.hxl.csv"))
; (define CodicemLinguam (csv->list (open-input-file "ontologia/codicem/codicem.numerum.hxl.csv")))
(define CodicemLocum (df-read/csv "ontologia/codicem/codicem.locum.hxl.csv"))
(define CodicemNumerum (df-read/csv "ontologia/codicem/codicem.numerum.hxl.csv"))
(define CodicemScriptum (df-read/csv "ontologia/codicem/codicem.scriptum.hxl.csv"))
; (define CodicemLinguam (df-read/csv "ontologia/codicem/codicem.linguam.hxl.csv"))
; ; (define CodicemLinguam (csv->list (open-input-file "ontologia/codicem/codicem.numerum.hxl.csv")))
; (define CodicemLocum (df-read/csv "ontologia/codicem/codicem.locum.hxl.csv"))
; (define CodicemNumerum (df-read/csv "ontologia/codicem/codicem.numerum.hxl.csv"))
; (define CodicemScriptum (df-read/csv "ontologia/codicem/codicem.scriptum.hxl.csv"))


; (writeln "CodicemLinguam")
(df-describe CodicemLinguam)
(write CodicemLinguam)
; ; (writeln "CodicemLinguam")
; (df-describe CodicemLinguam)
; (write CodicemLinguam)

(writeln "CodicemLocum")
(df-describe CodicemLocum)
; (writeln "CodicemLocum")
; (df-describe CodicemLocum)

(writeln "CodicemNumerum")
(df-describe CodicemNumerum)
; (writeln "CodicemNumerum")
; (df-describe CodicemNumerum)

(writeln "CodicemScriptum")
(df-describe CodicemScriptum)
; (writeln "CodicemScriptum")
; (df-describe CodicemScriptum)


; (csv->sxml (open-input-file "ontologia/codicem/codicem.numerum.hxl.csv"))

;; Example of how to print line by line an CSV
(csv-for-each
(lambda(x)
(writeln(string-join x)))
(make-csv-reader (open-input-file "ontologia/codicem/codicem.numerum.hxl.csv")))
16 changes: 16 additions & 0 deletions hdpl-conventions/prototype/hdpl/commune/structuram.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
;; - https://en.wiktionary.org/wiki/versio#Latin
;; - "dactylum"
;; - https://en.wiktionary.org/wiki/dactylus#Latin
;; - "collēctiōnem"
;; - https://en.wiktionary.org/wiki/collectio#Latin
;; - "coniūnctum"
;; - https://en.wiktionary.org/wiki/coniunctus#Latin

; @see - https://docs.racket-lang.org/reference/structutils.html
; @see - https://beautifulracket.com/explainer/data-structures.html
Expand Down Expand Up @@ -65,6 +69,17 @@
; hdpl-conventions/prototype/hdpl/ontologia/codicem/codicem.locum.hxl.csv
; (struct CodicemLocum (TODO))

;; An data struct that have pointer for several structs related to Linguam
(struct ConiunctumLinguam (CodicemLinguamCollectionem)
#:guard (struct-guard/c (or/c list? empty?))
)

;; An data struct that have pointer for several structs related to Striptum
(struct ConiunctumScriptum (CodicemScriptumCollectionem)
#:guard (struct-guard/c (or/c list? empty?))
)


;; Example of creating the struct
(CodicemLinguam 'arb empty empty empty 'I 'L "Standard Arabic")

Expand All @@ -73,3 +88,4 @@

; Access specific item
(CodicemScriptum-iso15924 (CodicemScriptum 'Kpel 436 "Kpelle" "kpèllé" empty empty '2016-12-05))

5 changes: 5 additions & 0 deletions ontologia/core.vkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ root:
# Doublet of date
# - https://en.wiktionary.org/wiki/datum#Latin
# > datum n (genitive datī); second declension gift, present
#
# TODO: maybe change the latin form to datum plus
# - https://en.wiktionary.org/wiki/coniunctus#Latin
# - https://en.wiktionary.org/wiki/collectio#Latin
# (Emerson Rocha, 2021-04-17 20:02 UTC)
id: 'hdatum'
id_alts:
- "datum"
Expand Down

0 comments on commit b11a3bf

Please sign in to comment.