Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ovos-option-matcher-fuzzy-plugin

Fuzzy-match OptionMatcherEngine plugin for OpenVoiceOS.

Resolves a free-form user utterance to one of a predefined set of option slots: the kind of matching needed by OVOSSkill.ask_selection. Supports 15 languages out of the box. Spoken positions are read with numtag.

Install

pip install ovos-option-matcher-fuzzy-plugin

How a skill uses it

Skills call self.ask_selection(options, dialog=...). The framework speaks the options to the user, collects a spoken response, then calls FuzzyOptionMatcherPlugin.match_option automatically. No skill code references the plugin directly.

from ovos_workshop.skills.ovos import OVOSSkill

class MySkill(OVOSSkill):
    def handle_intent(self, message):
        choice = self.ask_selection(
            ["play jazz", "play rock", "play classical"],
            dialog="what would you like"
        )
        # choice is one of the list elements, or None if nothing matched
        if choice:
            self.speak_dialog("you_chose", {"choice": choice})

The user can answer with:

  • A direct name: "rock music": matched by fuzzy scoring
  • An ordinal, a cardinal or digits: "the second one", "number seventeen", "option 7": read by numtag
  • A last-position reference: "the last one": matched by last.voc

ask_selection passes self.lang (canonical BCP-47, e.g. en-US) to the plugin.

How it works

Resolution runs in three stages: first match wins:

  1. Fuzzy match: rapidfuzz WRatio similarity against all options. Returns immediately if score ≥ min_conf (default 0.65).
  2. Last-option vocab: locale-aware last.voc words ("last", "final", "letzte", …). Returns the final option.
  3. Spoken position: numtag reads the numbers in the utterance. The first ordinal or cardinal whole number from 1 to the option count picks that option. A number out of range picks nothing, and an article ("uma guitarra") is no position.

Returns None if nothing matches.

Direct usage

from ovos_option_matcher_fuzzy import FuzzyOptionMatcherPlugin

matcher = FuzzyOptionMatcherPlugin()
options = ["play jazz music", "play rock music", "play classical music"]

matcher.match_option("jazz music", options)                   # "play jazz music"
matcher.match_option("the second one", options)               # "play rock music"
matcher.match_option("three", options)                        # "play classical music"
matcher.match_option("the last option", options)              # "play classical music"
matcher.match_option("die erste", options, lang="de-DE")      # "play jazz music"
matcher.match_option("xyzzy quux", options)                   # None

# Custom confidence threshold
strict = FuzzyOptionMatcherPlugin(config={"min_conf": 0.85})

Note: when the plugin is loaded automatically by ask_selection, it is instantiated with no config, so min_conf is always 0.65. Pass a custom value only when instantiating directly.

Supported languages

Last-word vocab is provided for the languages below. numtag reads numbers in each of them:

Tag Language
ca-ES Catalan
cs-CZ Czech
da-DK Danish
de-DE German
en-US English
es-ES Spanish
eu-ES Basque
fr-FR French
gl-ES Galician
it-IT Italian
nl-NL Dutch
pl-PL Polish
pt-BR Portuguese (Brazil)
pt-PT Portuguese (Portugal)
sv-SE Swedish

Falls back to the language prefix (de-DE → de) then en-US if a locale file is absent. Translations are contributed via the OVOS GitLocalize platform.

Entry point

Registered under opm.agents.option_matcher:

ovos-option-matcher-fuzzy-plugin = ovos_option_matcher_fuzzy:FuzzyOptionMatcherPlugin

This plugin is the default when no ask_selection_plugin is configured. See docs/integration.md for how to switch plugins per-skill or globally.

License

Apache 2.0

Metadata

Release files for ovos-option-matcher-fuzzy-plugin 0.0.4a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ovos-option-matcher-fuzzy-plugin 0.0.4a1
File Size Uploaded Provenance Actions
ovos_option_matcher_fuzzy_plugin-0.0.4a1.tar.gz 14.2 kB Without provenance Details for ovos_option_matcher_fuzzy_plugin-0.0.4a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ovos-option-matcher-fuzzy-plugin 0.0.4a1
File Interpreter ABI Platform Actions
ovos_option_matcher_fuzzy_plugin-0.0.4a1-py3-none-any.whl Python 3 none any Details for ovos_option_matcher_fuzzy_plugin-0.0.4a1-py3-none-any.whl

Total release size: 27.8 kB

Release files / ovos_option_matcher_fuzzy_plugin-0.0.4a1.tar.gz

Download URL ovos_option_matcher_fuzzy_plugin-0.0.4a1.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
356145634f2ff55c1b39c62881f3857fed97e7cf456d2ae26c2bbbb4c7daa781
BLAKE2b-256 checksum
How to use checksums
fe543ce017b41d1d5d835f4ac51eb83c5ac4aadbe01c7add9640479c54d79c9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ovos_option_matcher_fuzzy_plugin-0.0.4a1-py3-none-any.whl

Download URL ovos_option_matcher_fuzzy_plugin-0.0.4a1-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86dff4acfea29db6bebfcae587980bcd6b136b18e80c6223a89afbc77734e453
BLAKE2b-256 checksum
How to use checksums
192e3079af15a026189dc2c9c03c37f53e5bd8595ff85d6b103e285daee9500e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for ovos-option-matcher-fuzzy-plugin 0.0.4a1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page