-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:giellalt/lang-bla into main
- Loading branch information
Showing
10 changed files
with
3,931 additions
and
5,928 deletions.
There are no files selected for viewing
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#!/bin/sh | ||
|
||
# bla2json.sh | ||
|
||
# Transforms Blackfoot dictionary content in TSV format to IMPORTJSON format | ||
|
||
tr -d '"' | | ||
|
||
# tr -s '\r' '\n' | | ||
|
||
gawk -F"\t" 'BEGIN { } | ||
match($0, "^#")==0 { | ||
line[++nr]=$0; | ||
n=split(line[nr],s,"\t"); | ||
for(i=1; i<=n; i++) | ||
f[nr, i]=s[i]; | ||
} | ||
END { | ||
for(j=1; j<=n; j++) | ||
{ | ||
if(f[1, j]=="ROOT") root_col=j; | ||
if(f[1, j]=="ANALYSIS") anl_col=j; | ||
if(f[1, j]=="LEMMA") lemma_col=j; | ||
if(f[1, j]=="POS") pos_col=j; | ||
if(f[1, j]=="DEFINITION") gloss_col=j; | ||
if(f[1, j]=="DEFINITION2") gloss2_col=j; | ||
if(f[1, j]=="FORMOF") formof_col=j; | ||
} | ||
# IMPORTJSON format | ||
# [ | ||
# ⋮, | ||
# { | ||
# "analysis": [[], "nîmiw", ["+V", "+AI", "+Ind", "+3Sg"]], | ||
# "head": "nîmiw", | ||
# "linguistInfo": { "stem": "nîmi-" }, | ||
# "paradigm": "VAI", | ||
# "senses": [{ "definition": "s/he dances", "sources": ["CW"] }], | ||
# "slug": "nîmiw" | ||
# }, | ||
# { | ||
# "analysis": [[], "nîmiw", ["+V", "+AI", "+Ind", "+X"]], | ||
# "formOf": "nîmiw", | ||
# "head": "nîminâniwan", | ||
# "senses": [ | ||
# { | ||
# "definition": "it is a dance, a time of dancing", | ||
# "sources": ["CW"] | ||
# } | ||
# ] | ||
# }, | ||
# ⋮ | ||
# ] | ||
printf "[\n"; | ||
for(i=2; i<=nr; i++) | ||
{ | ||
lemma=f[i, lemma_col]; pos=f[i, pos_col]; gloss=f[i, gloss_col]; stem=f[i, root_col]; root=f[i, root_col]; | ||
fstanl=f[i, anl_col]; | ||
if(f[i, lemma3_col]!="") lemma=f[i, lemma3_col]; | ||
note1=f[i, note1_col]; note2=f[i, note2_col]; formof=f[i, formof_col]; | ||
if(formof=="") | ||
{ | ||
head=root; | ||
paradigm=pos; | ||
sub("-.*$", "",paradigm); | ||
slug=head; | ||
gsub("[ ]+", "_", slug); | ||
if(slug in slugs) | ||
{ | ||
slug=slug "@" ++slugs[slug]; | ||
} | ||
else | ||
slugs[slug]=1; | ||
m=match(fstanl, "^(.*\\+)*([^\\+]+)(\\+N|\\+V|\\+Ipc|\\+Pron|\\+Num)(.*)$", a); | ||
prefix=a[1]; | ||
lemma=a[2]; | ||
suffix=a[3] a[4]; | ||
gsub("\\+", "+\", \"", prefix); sub(", \"$", "", prefix); | ||
gsub("\\+", "\", \"+", suffix); sub("^\", ", "", suffix); | ||
if(prefix!="") prefix = "\"" prefix; | ||
if(suffix!="") suffix=suffix "\""; | ||
wc=a[3]; sub("^\\+","",wc); | ||
# analysis=sprintf("[%s], \"%s\", [%s]", prefix, lemma, suffix); | ||
printf " {\n"; | ||
printf " \"head\": \"%s\",\n", head; | ||
# printf " \"analysis\": [%s]\n", analysis; | ||
printf " \"linguistInfo\": {\n" | ||
printf " \"inflectional_category\": \"%s\",\n", pos; | ||
printf " \"stem\": \"%s\",\n", stem; | ||
printf " \"pos\": \"%s\",\n", wc; | ||
printf " \"wordclass\": \"%s\"\n", paradigm; | ||
printf " },\n"; | ||
printf " \"paradigm\": \"%s\",\n", paradigm; | ||
printf " \"senses\": [{ \"definition\": \"%s\", \"sources\": [\"F&R\"] }],\n", gloss; | ||
printf " \"slug\": \"%s\"\n", slug; | ||
printf " }"; | ||
if(i<nr) | ||
printf ",\n"; | ||
else | ||
printf "\n"; | ||
} | ||
} | ||
printf "]\n"; | ||
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ROOT POS DEFINITION DEFINITION2 ANALYSIS LEMMA | ||
inááttsi VII appear as, look like; have the appearance it appears as, it looks like; it has the appearance inááttsi+VII+Ind+0Sg inááttsiwa | ||
soka'pii VII be good it is good soka'pii+VII+Ind+0Sg soka'piiwa | ||
a'po'taki VAI work, be operational, be in effect s/he works, s/he is operational; s/he is in effect a'po'taki+VAI+Ind+3Sg á'po'takiwa | ||
itapoo VAI go toward, go to a location s/he goes toward, s/he goes to a location itapoo+VAI+Ind+3Sg itapoowa | ||
okska'si VAI run s/he runs okska'si+VAI+Ind+3Sg okska'siwa | ||
waahkayi VAI go home s/he goes home waahkayi+VAI+Ind+3Sg aahkayiwa | ||
ohkoissksini VTI find out about s/he finds out about s.t. ohkoissksini+VTI+Ind+3Sg+0SgO ohkoissksinima | ||
oowatoo VTI eat s/he eats s.t. oowatoo+VTI+Ind+3Sg+0SgO owatooma | ||
ssksini VTI know s/he knows s.t. ssksini+VTI+Ind+3Sg+0SgO ssksinima | ||
ikákomimm VTA love, be fond of s/he loves s.o., s/he is fond of s.o. ikákomimm+VTA+Ind+3Sg+4SgO ikákomimmiiwa | ||
# waakomimm VTA love, be fond of | ||
ino VTA see; recognize s/he sees s.o.; s/he recognizes s.o. ino+VTA+Ind+3Sg+4SgO inoyiiwa | ||
imitááwa NA dog imitááwa+NA+Sg imitááwa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
[ | ||
{ | ||
"head": "inááttsi", | ||
"linguistInfo": { | ||
"inflectional_category": "VII", | ||
"stem": "inááttsi", | ||
"pos": "V", | ||
"wordclass": "VII" | ||
}, | ||
"paradigm": "VII", | ||
"senses": [{ "definition": "appear as, look like; have the appearance", "sources": ["F&R"] }], | ||
"slug": "inááttsi" | ||
}, | ||
{ | ||
"head": "soka'pii", | ||
"linguistInfo": { | ||
"inflectional_category": "VII", | ||
"stem": "soka'pii", | ||
"pos": "V", | ||
"wordclass": "VII" | ||
}, | ||
"paradigm": "VII", | ||
"senses": [{ "definition": "be good", "sources": ["F&R"] }], | ||
"slug": "soka'pii" | ||
}, | ||
{ | ||
"head": "a'po'taki", | ||
"linguistInfo": { | ||
"inflectional_category": "VAI", | ||
"stem": "a'po'taki", | ||
"pos": "V", | ||
"wordclass": "VAI" | ||
}, | ||
"paradigm": "VAI", | ||
"senses": [{ "definition": "work, be operational, be in effect", "sources": ["F&R"] }], | ||
"slug": "a'po'taki" | ||
}, | ||
{ | ||
"head": "itapoo", | ||
"linguistInfo": { | ||
"inflectional_category": "VAI", | ||
"stem": "itapoo", | ||
"pos": "V", | ||
"wordclass": "VAI" | ||
}, | ||
"paradigm": "VAI", | ||
"senses": [{ "definition": "go toward, go to a location", "sources": ["F&R"] }], | ||
"slug": "itapoo" | ||
}, | ||
{ | ||
"head": "okska'si", | ||
"linguistInfo": { | ||
"inflectional_category": "VAI", | ||
"stem": "okska'si", | ||
"pos": "V", | ||
"wordclass": "VAI" | ||
}, | ||
"paradigm": "VAI", | ||
"senses": [{ "definition": "run", "sources": ["F&R"] }], | ||
"slug": "okska'si" | ||
}, | ||
{ | ||
"head": "waahkayi", | ||
"linguistInfo": { | ||
"inflectional_category": "VAI", | ||
"stem": "waahkayi", | ||
"pos": "V", | ||
"wordclass": "VAI" | ||
}, | ||
"paradigm": "VAI", | ||
"senses": [{ "definition": "go home", "sources": ["F&R"] }], | ||
"slug": "waahkayi" | ||
}, | ||
{ | ||
"head": "ohkoissksini", | ||
"linguistInfo": { | ||
"inflectional_category": "VTI", | ||
"stem": "ohkoissksini", | ||
"pos": "V", | ||
"wordclass": "VTI" | ||
}, | ||
"paradigm": "VTI", | ||
"senses": [{ "definition": "find out about", "sources": ["F&R"] }], | ||
"slug": "ohkoissksini" | ||
}, | ||
{ | ||
"head": "oowatoo", | ||
"linguistInfo": { | ||
"inflectional_category": "VTI", | ||
"stem": "oowatoo", | ||
"pos": "V", | ||
"wordclass": "VTI" | ||
}, | ||
"paradigm": "VTI", | ||
"senses": [{ "definition": "eat", "sources": ["F&R"] }], | ||
"slug": "oowatoo" | ||
}, | ||
{ | ||
"head": "ssksini", | ||
"linguistInfo": { | ||
"inflectional_category": "VTI", | ||
"stem": "ssksini", | ||
"pos": "V", | ||
"wordclass": "VTI" | ||
}, | ||
"paradigm": "VTI", | ||
"senses": [{ "definition": "know", "sources": ["F&R"] }], | ||
"slug": "ssksini" | ||
}, | ||
{ | ||
"head": "ikákomimm", | ||
"linguistInfo": { | ||
"inflectional_category": "VTA", | ||
"stem": "ikákomimm", | ||
"pos": "V", | ||
"wordclass": "VTA" | ||
}, | ||
"paradigm": "VTA", | ||
"senses": [{ "definition": "love, be fond of", "sources": ["F&R"] }], | ||
"slug": "ikákomimm" | ||
}, | ||
{ | ||
"head": "ino", | ||
"linguistInfo": { | ||
"inflectional_category": "VTA", | ||
"stem": "ino", | ||
"pos": "V", | ||
"wordclass": "VTA" | ||
}, | ||
"paradigm": "VTA", | ||
"senses": [{ "definition": "see; recognize", "sources": ["F&R"] }], | ||
"slug": "ino" | ||
}, | ||
{ | ||
"head": "imitááwa", | ||
"linguistInfo": { | ||
"inflectional_category": "NA", | ||
"stem": "imitááwa", | ||
"pos": "N", | ||
"wordclass": "NA" | ||
}, | ||
"paradigm": "NA", | ||
"senses": [{ "definition": "dog", "sources": ["F&R"] }], | ||
"slug": "imitááwa" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.