-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
177 additions
and
41 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,19 @@ | ||
#!/usr/bin/env python | ||
""" | ||
Command-line utility for administrative tasks. | ||
""" | ||
|
||
import os | ||
import sys | ||
from pathlib import Path | ||
|
||
# sys.path[0] is initialized to the directory containing the script, which | ||
# isn’t right for our purposes. | ||
sys.path[0] = os.fspath(Path(sys.path[0]) / "src") | ||
|
||
if __name__ == "__main__": | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blaeng.site.settings") | ||
|
||
from django.core.management import execute_from_command_line | ||
|
||
execute_from_command_line(sys.argv) |
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 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 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 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 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 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,64 @@ | ||
# Generating a new site from scratch | ||
|
||
These are all the instructions I followed to create this new version. | ||
|
||
``` | ||
./crkeng-manage newdictsite --port 8011 -v 2 bla eng | ||
# Add blaeng to morphodict/src/conftest.py | ||
# Add MORPHODICT_LANGUAGE_ENDONYM to src/blaeng/site/settings.py | ||
# Add many other details, copying from Woods Cree settings.py, including: | ||
# MD_SOURCE_LANGUAGE_NAME MD_SOURCE_LANGUAGE_SHORT_NAME MD_ORTHOGRAPHY MD_DICTIONARY_NAME | ||
./blaeng-manage migrate | ||
./blaeng-manage ensurecypressadminuser --superuser | ||
./blaeng-manage ensuretestdb | ||
# MISSING TRANSDUCERS | ||
``` | ||
|
||
I had to make transducers. Generating from the instructions we just collected today! | ||
|
||
`git clone giellalt/lang-bla` | ||
after generating the FSTs with the default infrastructure: | ||
``` | ||
hfst-xfst | ||
``` | ||
And ran: | ||
``` | ||
read lexc src/fst/morphology/lexicon.lexc | ||
define Morphology | ||
source src/fst/bla-phonology.xfscript | ||
define Phonology | ||
regex ~[ $[ "+Err/Frag" ]]; | ||
define removeFragments | ||
regex ~[ $[ "+Err/Orth" ]]; | ||
define removeNonStandardForms | ||
regex $[ "+N" | "+V" | "+Ipc" | "+Pron" ]; | ||
define selectDictPOS | ||
set flag-is-epsilon ON | ||
regex [ selectDictPOS .o. removeNonStandardForms .o. removeFragments .o. Morphology .o. Phonology ]; | ||
save stack generator-gt-dict-norm.hfst | ||
define NormativeGenerator | ||
regex [ [ "<" | ">" | "/" ] -> 0 ]; | ||
define removeBoundaries | ||
load src/fst/orthography/spellrelax.compose.hfst | ||
define SpellRelax | ||
regex [ selectDictPOS .o. removeFragments .o. Morphology .o. Phonology .o. removeBoundaries .o. SpellRelax ]; | ||
# regex [ NormativeGenerator .o. removeBoundaries .o. SpellRelax ]; | ||
invert net | ||
save stack analyser-gt-dict-desc.hfst | ||
define DescriptiveAnalyser | ||
``` | ||
|
||
|
||
And then we create the `hfstol` files with: | ||
|
||
``` | ||
hfst-fst2fst -O -i INPUT.hfst -o OUTPUT.hfstol | ||
``` | ||
|
||
After this, `./blaeng-manage ensuretestdb` works. | ||
|
||
``` | ||
./blaeng-manage importjsondict src/blaeng/resources/dictionary/blaeng_test_db.importjson | ||
``` |
Empty file.
Empty file.
Empty file.
Git LFS file not shown
Git LFS file not shown
Empty file.
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,58 @@ | ||
""" | ||
Django settings for blaeng. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/3.2/topics/settings/ | ||
For the full list of settings and their values, see | ||
https://docs.djangoproject.com/en/3.2/ref/settings/ | ||
""" | ||
|
||
from pathlib import Path | ||
|
||
from morphodict.site import base_dir_setup | ||
|
||
BASE_DIR = Path(__file__).resolve().parent.parent | ||
|
||
base_dir_setup.set_base_dir(BASE_DIR) | ||
|
||
from morphodict.site.settings import * | ||
|
||
# Where this application should be deployed: | ||
PRODUCTION_HOST = "blaeng.altlab.dev" | ||
|
||
ALLOWED_HOSTS.append(PRODUCTION_HOST) | ||
|
||
DEFAULT_RUNSERVER_PORT = 8011 | ||
|
||
INSTALLED_APPS.insert(0, "blaeng.app") | ||
|
||
# Morphodict configuration | ||
|
||
# The ISO 639-1 code is used in the lang="" attributes in HTML. | ||
MORPHODICT_ISO_639_1_CODE = "bla" | ||
|
||
MORPHODICT_SOURCE_LANGUAGE = "bla" | ||
MORPHODICT_TARGET_LANGUAGE = "eng" | ||
|
||
MORPHODICT_SOURCE_LANGUAGE_NAME = "Blackfoot" | ||
MORPHODICT_SOURCE_LANGUAGE_SHORT_NAME = "Blackfoot" | ||
|
||
MORPHODICT_LANGUAGE_ENDONYM = "ᓱᖽᐧᖿ" | ||
|
||
MORPHODICT_DICTIONARY_NAME = "sínaakia’tsis" | ||
|
||
RELAXED_ANALYZER_FST_FILENAME = "analyser-gt-dict-desc.hfstol" | ||
STRICT_ANALYZER_FST_FILENAME = RELAXED_ANALYZER_FST_FILENAME | ||
STRICT_GENERATOR_FST_FILENAME = "generator-gt-dict-norm.hfstol" | ||
|
||
MORPHODICT_ORTHOGRAPHY = { | ||
"default": "Latn", | ||
"available": { | ||
"Latn": {"name": "Latin"}, | ||
"Cans": { | ||
"name": "Syllabics", | ||
"converter": "CreeDictionary.CreeDictionary.orthography.to_syllabics", | ||
}, | ||
}, | ||
} |
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