Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add fuzzy matching capabilities #18

Merged
merged 1 commit into from Jul 4, 2022
Merged

add fuzzy matching capabilities #18

merged 1 commit into from Jul 4, 2022

Conversation

emphasize
Copy link
Contributor

@emphasize emphasize commented Jul 4, 2022

Closes: #17 #16

The request routine is rewritten allowing one additional api call if a search term is found (If no suggestion is given the while loop will exit) . This allows to leverage suggestions for the TuneIn API in case mycroft misunderstood/misspelled the requested station.

Fuzzy matching is introduced to sort the request for the correct station uttered.

In tandem these two additions should make the request more consistent/convenient.

This tackles two main flaws:

The station to be played is picked from the top of the list (NodeList). Since this not always reflects the uttered station (eg a request for "Deutschlandfunk" plays the stream of "Deutschlandfunk Nova" as a result - while "Deutschlandfunk" would be an option) fuzzy matching is introduced to ensure the best match is played.

Secondly, a TTS or otherwise butchered utterance (like with the example above if it understands "Deutschlandfunk Nowa" (w)) would result in "station not found". This inconvenience is intercepted by utilizing the APIs fuzzy matching capability. In this case the request is performed twice with the top suggested station

(cherry picked from commit b95005b)
Copy link
Owner

@johnbartkiw johnbartkiw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I currently don't have a working dev setup for mycroft so I can't easily test the PR. It looks fine but if there are issues I would appreciate you submitting fixes.

@johnbartkiw johnbartkiw merged commit ad6ab03 into johnbartkiw:master Jul 4, 2022
@emphasize
Copy link
Contributor Author

that's for sure. Not expected that responsiveness, i already found an artifact that doesn't need to be there.

@johnbartkiw
Copy link
Owner

I hate projects that don't respond to PRs quickly so I try and respond in a reasonable time if the PR looks good and helps, even if I'm not as active as I should be. :)

If you want to do a cleanup PR to handle any dangling old code I'd be glad to accept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Perform a second API call if alternatives were given
2 participants