+tokipona
This commit is contained in:
parent
ec48ddba4e
commit
e1d3666dcd
@ -19,6 +19,7 @@
|
||||
|Snap|`(?i)^snap:$`|checks the current build date of OpenBSD snapshots.|
|
||||
|Source|`(?i)where is your (source|code)`|Tell people where they can find more information about myself.|
|
||||
|Thanks|`(?i)^thank you|thank you$|^thanks|thanks$|^ty|ty$`|Bots should be respectful. Respond to thanks.|
|
||||
|Toki|`(?i)^toki: (.+)$`|Toki Pona dictionary|
|
||||
|Version|`(?i)version$`|Show a bit of information about what we are.|
|
||||
|Wb|`(?i)^welcome back|welcome back$|^wb|wb$`|Respond to welcome back messages.|
|
||||
|Weather|`(?i)^weather: (\d+)$`|Produce weather information for a given ZIP code. Data comes from openweathermap.org.|
|
||||
|
@ -212,6 +212,7 @@ var Plugs = Plugins{
|
||||
&Snap{},
|
||||
&Source{},
|
||||
&Thanks{},
|
||||
&Toki{},
|
||||
&Version{},
|
||||
&Wb{},
|
||||
&Weather{},
|
||||
|
2447
plugins/toki_pona.go
Normal file
2447
plugins/toki_pona.go
Normal file
File diff suppressed because it is too large
Load Diff
34
scripts/parse_toki-pona_ding.awk
Normal file
34
scripts/parse_toki-pona_ding.awk
Normal file
@ -0,0 +1,34 @@
|
||||
# Script to parse https://raw.githubusercontent.com/jan-Lope/Toki_Pona_lessons_English/gh-pages/toki-pona_english.txt
|
||||
# run with: grep "::" toki-pona_english.txt | grep "[a-z]: " | awk -F: -f parse_toki-pona_ding.awk
|
||||
{
|
||||
gsub(/ $/, "", $1);
|
||||
gsub(/^ /, "", $1);
|
||||
|
||||
gsub(/ $/, "", $3);
|
||||
gsub(/^ /, "", $3);
|
||||
|
||||
gsub(/ $/, "", $NF);
|
||||
gsub(/^ /, "", $NF);
|
||||
|
||||
words[$1] = words[$1] "#" "$" $3 "$" $NF;
|
||||
}
|
||||
|
||||
END {
|
||||
for (w in words) {
|
||||
split(words[w], pnd, "#")
|
||||
print "\""w"\": []Toki{"
|
||||
print "\tToki{"
|
||||
split(pnd[2], a, "$")
|
||||
print "\t\tPOS: " "\""a[2]"\","
|
||||
split(a[3], b, ",")
|
||||
print "\t\tMeanings: []string{"
|
||||
for (x in b) {
|
||||
gsub(/ $/, "", b[x]);
|
||||
gsub(/^ /, "", b[x]);
|
||||
print "\t\t\t\""b[x]"\","
|
||||
}
|
||||
print "\t\t},"
|
||||
print "\t},"
|
||||
print "},"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user