挪威语-萨米语翻译服务器

用于挪威语和萨米语(北萨米语和南萨米语)之间翻译的服务器,支持离线和在线词典查询。

  • by Qvakk
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 Qvakk/bokmal-sami-dictionary-mcp

使用说明

书签Samic MCP服务器

MCP服务器,用于在挪威博克马尔语和萨米斯克语(北萨米斯克/nordsamisk和南萨米斯克/sørsamisk)之间进行翻译,具有离线+在线词典查找功能。

快速开始


# Clone and run
git clone https://github.com/qvakk/bokmal-samisk-mcp.git
cd bokmal-samisk-mcp
uv run bokmal-samisk-mcp

就是这样。服务器启动 http://localhost:8000/mcp 使用可流式传输的http。

或者用pip

pip install -e .
bokmal-samisk-mcp

或者使用Docker

docker build -t bokmal-samisk-mcp .
docker run -p 8000:8000 bokmal-samisk-mcp

工具

工具 说明
lookup_samisk_to_bokmal 萨米斯克语→ Bokmål定义(离线CSV)
lookup_bokmal_to_samisk 博克马尔语→ Samisk翻译(离线CSV)
lookup_online 通过gtweb.uit.no实时搜索文件数据
generate_vocabulary_quiz 从字典中生成测验问题
assess_proficiency 根据测验成绩评估CEFR熟练程度

lookup_samis_to_bokmal

{
  "word": "giella",
  "language": "sme",
  "exact": true
}

lookup_bokmal_to_samisk

{
  "word": "bestemor",
  "language": "sma"
}

在线查询

获取活体 Giellatekno Webdict trie数据获取最新翻译。

{
  "word": "giella",
  "language": "sme",
  "exact": false
}

语言

代码 语言 词典条目
sme 北萨米人~42000人。
sma 南萨米人~120000。

建筑

bokmal_samisk_mcp/
├── server.py       # FastMCP server with all tool definitions
├── dictionary.py   # Offline CSV dictionary with forward + reverse indexes
└── online.py       # Online trie-based lookup from gtweb.uit.no

离线:将Giellatekno的CSV文件加载到转发(samisk→bokmal)和反向(bokmal→samisk)索引首次使用时。

在线的:从下载gzip压缩的JSON trie https://gtweb.uit.no/webdict/tries/{lang}-nob.json.gz 并在内存中缓存。webdict SPA使用的数据相同。

发展

# Install dev dependencies
uv sync --extra dev

# Run tests (offline only)
uv run pytest tests/test_dictionary.py tests/test_tools.py -v

# Run all tests including online (requires network)
uv run pytest tests/ -v

# Lint
uv run ruff check .

在线词典

  • 北萨米斯克↔ 博克马尔:https://gtweb.uit.no/webdict/sme-nob/
  • 南萨米人↔ 博克马尔:https://gtweb.uit.no/webdict/sma-nob/

字典数据来自 吉拉泰克诺 挪威北极大学。

许可证

麻省理工学院