{"id":29507958,"url":"https://github.com/divvun/divvun-api","last_synced_at":"2025-07-16T04:07:07.564Z","repository":{"id":37178857,"uuid":"160066421","full_name":"divvun/divvun-api","owner":"divvun","description":"Web server for language processing","archived":false,"fork":false,"pushed_at":"2023-11-28T21:12:38.000Z","size":1100,"stargazers_count":4,"open_issues_count":9,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-01T23:55:19.749Z","etag":null,"topics":["indigenous-languages","language-technology","minority-language","openapi","proofing-tools"],"latest_commit_sha":null,"homepage":"https://divvun.github.io/divvun-api","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/divvun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-02T16:24:05.000Z","updated_at":"2023-03-09T22:39:14.000Z","dependencies_parsed_at":"2022-06-24T04:12:27.417Z","dependency_job_id":null,"html_url":"https://github.com/divvun/divvun-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/divvun/divvun-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divvun%2Fdivvun-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divvun%2Fdivvun-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divvun%2Fdivvun-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divvun%2Fdivvun-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/divvun","download_url":"https://codeload.github.com/divvun/divvun-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divvun%2Fdivvun-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265480764,"owners_count":23773781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["indigenous-languages","language-technology","minority-language","openapi","proofing-tools"],"created_at":"2025-07-16T04:07:05.580Z","updated_at":"2025-07-16T04:07:07.556Z","avatar_url":"https://github.com/divvun.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Divvun API\n\nStarts a web server for accessing the Divvun spellcheck API.\n\nSee https://divvun.github.io/divvun-api/index.html for installation and usage documentation instructions.\n\n## OpenAPI\n\nThe OpenAPI documentation is generated with [ReDoc](https://github.com/Redocly/redoc) and hosted at  https://divvun.github.io/divvun-api/redoc-static.html\n\nTo refresh the documentation, install the [redoc-cli](https://github.com/Redocly/redoc/blob/master/cli/README.md) NPM package (`npm i -g redoc-cli`) and run `redoc-cli bundle openapi.yml`.\nThis will generate a `redoc-static.html` file that needs to be placed in the `docs` folder.\n\nTo refresh `docs/index.html`, `cd docs/` and run `asciidoctor index.adoc`.\n\n## Testing\n\nTests use the files in `tests/resources/data_files`. The files need to be organized as follows before running `cargo test`:\n\n```\ntests\n|--resources\n   |--data_files\n      |  se.zcheck\n      |  se.zhfst\n      |  smj.zcheck\n      |  smj.zhfst\n      |\n      |--grammar\n         |  se.zcheck\n      |--hyphenation\n         |  se.hfstol\n      |--spelling\n         |  se.zhfst\n```\n\nThe base `data_files` folder is expected to have both `se` and `smj`\ngrammar (`.zcheck`) and checker (`.zhfst`) files for the purposes of testing the file watcher, and\nthe `se` files are also expected to be present in the `spelling`, `hyphenation`, and `grammar` folders for testing loading of files at startup.\n\n- run `cargo test`\n\n## Deployment\n\nAdditional steps for deployment.\n\n### Requirements\n\n- Create a regular user with sudo privileges (default: *ubuntu*)\n- Create an API user with which the API will run (default: *api*)\n- Setup SSH access\n- Install python\n\nSet the `admin_email` variable to receive emails from Let's Encrypt when it's time to renew the HTTPS certificate.\n\n\n### Docker image\n\nThis project is built and pushed into a docker image. The docker images is deployed by the https://github.com/divvun/divvun-api-deploy/\n\nYou need to build the docker image on an x86 machine. An m1 mac won't do.\n\n\n```\ndocker build -t divvun/divvun-api:v2 .\n```\n\nNow.. this image is not uploaded to a repository. It just sits there. You'll have to pack it yourself. \n\n### Crimes\n\n\nBasic litmus tests for spellers and grammar\n\n```sh\n$ curl -X POST -H 'Content-Type: application/json' 'https://api-giellalt.uit.no/speller/se' --data '{\"text\": \"pahkat\"}'\n{\"text\":\"pahkat\",\"results\":[{\"word\":\"pahkat\",\"is_correct\":false,\"suggestions\":[{\"value\":\"páhkat\",\"weight\":15.301758},{\"value\":\"páhkkat\",\"weight\":21.3018},{\"value\":\"dahkat\",\"weight\":33.012695},{\"value\":\"háhkat\",\"weight\":34.89453},{\"value\":\"ráhkat\",\"weight\":38.691406},{\"value\":\"čáhkat\",\"weight\":38.79785},{\"value\":\"hahkát\",\"weight\":39.896484},{\"value\":\"báhkat\",\"weight\":39.89746},{\"value\":\"Ráhkat\",\"weight\":40.05078},{\"value\":\"páhka\",\"weight\":40.301758}]}]\n$ curl -X POST -H 'Content-Type: application/json' 'https://api-giellalt.uit.no/grammar/se' --data '{\"text\": \"Danne lea politijuristtaide eanemus praktihkkalaččat vuogas dan dahkat Čáhcesullos.\"}'\n{\"text\":\"Danne lea politijuristtaide eanemus praktihkkalaččat vuogas dan dahkat Čáhcesullos.\",\"errs\":[{\"error_text\":\"politijuristtaide\",\"start_index\":10,\"end_index\":27,\"error_code\":\"typo\",\"description\":\"Ii leat sátnelisttus\",\"suggestions\":[\"politiijajuristtaide\"],\"title\":\"Čállinmeattáhus\"},{\"error_text\":\"praktihkkalaččat\",\"start_index\":36,\"end_index\":52,\"error_code\":\"typo\",\"description\":\"Ii leat sátnelisttus\",\"suggestions\":[\"praktihkalaččat\",\"praktihkalat\",\"praktihkalet\",\"praktihkalit\",\"praktihkalut\"],\"title\":\"Čállinmeattáhus\"}]}%\n```\n\n\nPack your image:\n```sh\ndocker save divvun/divvun-api:v2 | gzip \u003e divvun-api-v2.tar.gz\n```\n\nCopy your image to the divvun-api server:\n```\nscp divvun-api-v2.tar.gz root@64.225.76.53:\n```\n\nLoad your image up\n```sh\n% ssh root@64.225.76.53\n$ gunzip --stdout divvun-api-v2.tar.gz | docker load\n8553b91047da: Loading layer [==================================================\u003e]  84.01MB/84.01MB\n22050e545130: Loading layer [==================================================\u003e]  22.38MB/22.38MB\n16c60edfa394: Loading layer [==================================================\u003e]    215kB/215kB\n86ffb3b2b27a: Loading layer [==================================================\u003e]  80.01MB/80.01MB\nc642b882d7d8: Loading layer [==================================================\u003e]  1.536kB/1.536kB\n0b38c186a861: Loading layer [==================================================\u003e]  16.72MB/16.72MB\n75784fda3f36: Loading layer [==================================================\u003e]   2.56kB/2.56kB\nLoaded image: divvun/divvun-api:v2\n```\n\nThe default user is API. Switch to it, go to the deploy directory and change the docker-compose to use your new tag. The restart docker-compose and start tailing the newly started divvun-api container. \n\n```sh\nsu api -s /bin/bash\ncd /home/api/dist\nnano -w docker-compose.yml #change the image to use :v2\ndocker-compose restart\ndocker logs -n10 -f dist_divvun_api_1\n```\n\nAnd then you rerun your litmus tests. Make sure to change the languages around so you're not testing.. something that would have worked anyway.\nAnd then you change your grammar packages around. And then you rerun the litmus tests. \n\nUltimately, you update the https://github.com/divvun/divvun-api-deploy/ repo and stop doing crimes. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivvun%2Fdivvun-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivvun%2Fdivvun-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivvun%2Fdivvun-api/lists"}