-
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.
Created some helper scripts, for extracting flags and tags from LEXC …
…files, and aggregating multiple LEC files into a single one.
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
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,3 @@ | ||
#!/bin/sh | ||
|
||
cat root.lexc noun_prefixes.lexc noun_stems.lexc noun_suffixes.lexc verb_prefixes.lexc prevn.lexc verb_stems.lexc verb_suffixes.lexc > lexicon.lexc |
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,18 @@ | ||
#!/bin/sh | ||
|
||
# extract-flags.sh (LEXC) | ||
|
||
# Usage: | ||
# cat lexicon.lexc | ./extract-flags.sh | ||
|
||
gawk '{ | ||
sub("!.*$",""); | ||
while(match($0,"@[^@]+@",f)!=0) | ||
{ | ||
sub(f[0],""); flags[f[0]]++; | ||
} | ||
} | ||
END { | ||
PROCINFO["sorted_in"]="@ind_str_asc"; | ||
for(ff in flags) print ff; | ||
}' |
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,20 @@ | ||
#!/bin/sh | ||
|
||
# extract-flags.sh (LEXC) | ||
|
||
# Usage: | ||
# cat lexicon.lexc | ./extract-flags.sh | ||
|
||
gawk '{ | ||
sub("!.*$",""); | ||
while(match($0,"\\+[^\\+]+",f)!=0) | ||
{ | ||
tag=f[0]; | ||
gsub("\\+","\\+",tag); | ||
sub(tag,""); tags[tag]++; | ||
} | ||
} | ||
END { | ||
PROCINFO["sorted_in"]="@ind_str_asc"; | ||
for(tt in tags) print tt; | ||
}' |