mherger wrote:
> This sounds very interesting! I hadn't seen scriptable before...
Scriptable is quite a powerful tool. It is a lot easier doing anything
non-trivial in Javascript than within Shortcuts' visual programming
environment. The main limitation currently is that it can only present
information to Siri, not request input. Hence, any non-trivial
interaction within Siri requires Shortcuts to be used to obtain the
necessary input first.
> Alas, at this point it looks as if I had to translate most of your code
>
> to German, otherwise it wouldn't work, correct?
Yes, I'm afraid that all of the language processing in the script is
currently just for English. My foreign language skills aren't adequate
for it to be worth me attempting translations...
If you don't mind the responses being in English then I think the only
required changes to support input in a different language are:
- The commands and componentPatterns constants which do the main
command parsing. commands provides the structure of the commands with
different sentence structures, and componentPatterns provides the
detailed regexps for the components of those commands and synonyms
that can be used.
- The digits array which is used to convert words for single-digit
numbers into their values. Siri in English tends to use words for
single digit numbers, but numerals for larger values. Both need to be
handled for setting volume, or for matching against playlist names
like "Radio 2".
- The regexp used in doPlaylistLoad for the assignment to
compoundParsed. This is used to handle search terms like
"-album-|-track- by -artist-".
Nothing else within the script applies any meaning to the input.
Unfortunately, construction of responses is littered throughout the
script. Translating all of the output would be a much bigger job.
> I'm even having problems making Siri understand "Squeezebox". She's
> always making "Squeeze Box" out of it.
You could rename the shortcut(s) to any other trigger phrase that you
like.
However, this touches on a problem with my script in its current form.
Siri's speech recognition attempts to apply its own sense of context to
what it hears... which the script then supplies to LMS as the search:
parameter of the genres, artists, albums, and/or titles commands. Unless
Siri ended up with precisely the same spelling the server obviously
won't provide a match. It works most of the time for me, but there are a
few artist and album names that rarely, if ever, work.
For playlists the script retrieves all of the playlist names and
performs the matching on the client, which provides some scope for
checking alternatives, such as allowing words to be substituted for
numerals. Actually, this local matching is also applied to the other
queries, mainly to restrict the results of the albums search to matches
in the album title rather than those that only match a track title on
the album... but it doesn't help if the required item wasn't returned by
the server in the first place.
Using this approach for artists, albums, and titles would probably be
too slow (and consume too much memory) for Scriptable to run in the Siri
context... at least not without keeping a local cache.
------------------------------------------------------------------------
thouky's Profile: http://forums.slimdevices.com/member.php?userid=42109
View this thread: http://forums.slimdevices.com/showthread.php?t=109784
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins