Boggle 求解器:专业字典词汇查找工具 - Openclaw Skills

作者:互联网

2026-03-24

AI教程

什么是 Boggle 求解器?

Boggle 求解器是为 Openclaw Skills 库设计的强大工具,旨在识别 4x4 字母网格中的所有有效单词。与可能生成不存在单词的标准 AI 模型不同,此技能使用纯字典匹配系统以确保 100% 的准确性。它利用快速的基于 Trie 的深度优先搜索 (DFS) 算法即时剪枝搜索路径,是竞技比赛或自动拼图求解的理想选择。

该工具专门为需要可靠方式处理单词游戏数据的开发人员和爱好者而优化。通过与 Openclaw Skills 集成,用户可以弥合视觉输入(如游戏板照片)与经过验证的文本结果之间的差距。它包含对英文(35.9 万词)和德文(135 万词)词汇的全面支持,并在独立、标记清晰的板块中展示结果。

下载入口:https://github.com/openclaw/skills/tree/main/skills/christianhaberl/boggle

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install boggle

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 boggle。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Boggle 求解器 应用场景

  • 从上传的实体游戏板照片中自动解决 Boggle 拼图。
  • 为竞技类单词游戏训练验证高分单词列表。
  • 为 Openclaw Skills 生态系统内的单词拼图应用提供可靠的后端支持。
  • 增强 AI 代理处理多语言单词发现任务的能力。
Boggle 求解器 工作原理
  1. 该技能接收 4x4 网格输入,通常从照片中提取或作为 16 个字母的字符串提供。
  2. 系统在处理前向用户确认网格布局,以确保数据完整性。
  3. 从捆绑的字典文件中构建 Trie 数据结构(在首次运行时执行一次)。
  4. 求解器从网格中的每个单元格启动深度优先搜索 (DFS),探索所有 8 个相邻方向。
  5. 如果路径与 Trie 中的有效前缀不匹配,则实时剪枝,确保求解时间少于 5 毫秒。
  6. 该技能分别为英语和德语运行独立通道,然后输出按语言和分数分类的结果。

Boggle 求解器 配置指南

要在 Openclaw Skills 环境中使用此求解器,请确保已安装 Python 3。词典将在首次执行时自动下载。使用以下命令求解棋盘:

# 使用行作为参数求解 (英语)
python3 skills/boggle/scripts/solve.py ABCD EFGH IJKL MNOP --lang en

# 使用完整字母字符串求解 (德语)
python3 skills/boggle/scripts/solve.py --letters ABCDEFGHIJKLMNOP --lang de

Boggle 求解器 数据架构与分类体系

该技能管理两个主要的字典文件,并可以输出结构化的 JSON 数据,以便与其他 Openclaw Skills 组件集成。

文件名 语言 单词数量
words_english_boggle.txt 英语 359,000
words_german_boggle.txt 德语 1,350,000

适用的标准计分规则:

  • 3-4 个字母:1 分
  • 5 个字母:2 分
  • 6 个字母:3 分
  • 7 个字母:5 分
  • 8 个及以上字母:11 分
name: boggle
description: Solve Boggle boards — find all valid words (German + English) on a 4x4 letter grid. Use when the user shares a Boggle photo, asks for words on a grid, or plays word games. Includes 1.7M word dictionaries (DE+EN).

Boggle Solver

Fast trie-based DFS solver with dictionary-only matching. No AI/LLM guessing — words are validated exclusively against bundled dictionaries (359K English + 1.35M German).

Workflow (from photo)

  1. Read the 4x4 grid from the photo (left-to-right, top-to-bottom)
  2. Show the grid to the user and ask for confirmation before solving
  3. Only after user confirms → run the solver
  4. Always run English and German SEPARATELY — present as two labeled sections (???? / ????)

Solve a board

# English
python3 skills/boggle/scripts/solve.py ELMU ZBTS ETVO CKNA --lang en

# German
python3 skills/boggle/scripts/solve.py ELMU ZBTS ETVO CKNA --lang de

Each row is one argument (4 letters). Or use --letters:

python3 skills/boggle/scripts/solve.py --letters ELMUZBTSETVOCKNA --lang en

Options

Flag Description
--lang en/de Language (default: en; always run EN and DE separately)
--min N Minimum word length (default: 3)
--json JSON output with scores
--dict FILE Custom dictionary (repeatable)

Scoring (standard Boggle)

  • 3-4 letters: 1 pt
  • 5 letters: 2 pts
  • 6 letters: 3 pts
  • 7 letters: 5 pts
  • 8+ letters: 11 pts

How it works

  • Builds a trie from dictionary files (one-time, ~11s)
  • DFS traversal from every cell, pruned by trie prefixes
  • Adjacency: 8 neighbors (horizontal, vertical, diagonal)
  • Each cell used at most once per word
  • Qu tile support: Standard Boggle "Qu" tiles are handled as a single cell (e.g., QUENHARI... → "QU" occupies one position)
  • All matching is dictionary-only — no generative/guessed words

Data

Dictionaries are auto-downloaded from GitHub on first run if missing.

  • data/words_english_boggle.txt — 359K English words
  • data/words_german_boggle.txt — 1.35M German words

Performance

  • Trie build: ~11s (first run, 1.7M words)
  • Solve: <5ms per board