WireWordTools
ProcessWire API methods for English word inflection and lemmatisation, plus ability to use them in search queries.
Install / Use
/learn @ryancramerdesign/WireWordToolsREADME
ProcessWire Word Tools module
Currently focused on English language word functions including inflection and lemmatisation. Provides a simple API for using these functions.
Provides the ability to automatically hook into ProcessWire (3.0.162+) to enhance text searches that use any operator with a plus in "+" in it, which are the query expansion operators. For example, a search query for “fishing boat” …
$pages->find('title~|+=fishing boat');
…would automatically expand to include all these words: fishing, fished, fishes, fish, boat, boats, boating.
Please note the results are not always going to be perfect here, but intended to strike a balance between maintainability and accuracy. The goal being to provide potentially helpful word additions for ProcessWire-based search engines needing word variations.
The JSON dictionary files in the ./lemmas/ and ./roots/ directories was converted from PHP files in the Lemmatizer project © 2018 Mark Fullmer.
Install
- Copy all module files to:
/site/modules/WireWordTools/ - In the ProcessWire admin, click to Modules > Refresh
- On the Modules > Site tab, click “Install” for this module.
API Methods
// Get instance of module
$tools = $modules->get('WireWordTools');
// Get alternate words for given word
// returns [ 'words', 'worded', 'wording' ]
$words = $tools->getWords('word');
// Get plural value of given word
// returns "words"
$plural = $tools->getPlural('word');
// Get singular value of given word
// returns "word"
$singular = $tools->getSingular('words');
This module is a work in progress and more methods are likely to be added, word data expanded, etc.
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
