|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<!-- |
| 3 | +This file contains the regular expressions patterns used for figuring out what action the user wishes to take. When |
| 4 | +adding translations, please do not modify (.*), $1, ([0-9]+), etc. |
| 5 | +--> |
| 6 | +<resources> |
| 7 | + <!-- |
| 8 | + This pattern is the main pattern that will need to be matched in order for anything to be done. As you can see it is |
| 9 | + a quite complicated regular expression. Plugging it into https://www.debuggex.com/ should help you figure out how |
| 10 | + it is constructed. |
| 11 | + --> |
| 12 | + <item name="pattern_recognition" type="string">^(((lancer|reprendre lecture|écouter|lancer film) (.+))|((position) (.+))|((pause|reprise|arrêt) lecture))(sur (.+))?</item> |
| 13 | + |
| 14 | + <item name="pattern_resume_watching" type="string">^reprendre lecture (.+)</item> |
| 15 | + <item name="pattern_watch" type="string">lancer $1</item> |
| 16 | + <item name="pattern_watch_movie" type="string">lancer film (.+)</item> |
| 17 | + <item name="pattern_watch_season_episode_of_show" type="string">lancer saison ([0-9]+) épisode ([0-9]+) of (.+)</item> |
| 18 | + <item name="pattern_watch_show_season_episode" type="string">lancer (.+) saison ([0-9]+) épisode ([0-9]+)</item> |
| 19 | + <item name="pattern_watch_episode_of_show" type="string">lancer épisode (.+) of (.+)</item> |
| 20 | + <item name="pattern_watch_next_episode_of_show" type="string">lancer( le)? prochain épisode de (.+)</item> |
| 21 | + <item name="pattern_watch_latest_episode_of_show" type="string">lancer( le)? dernier épisode de (.+)</item> |
| 22 | + <item name="pattern_watch_show_episode_named" type="string">lancer (.+) épisode (.+)</item> |
| 23 | + <item name="pattern_watch2" type="string">lancer (.+)</item> |
| 24 | + |
| 25 | + <!-- |
| 26 | + The following pattern lets the user say "listen to <album> by <artist>" or |
| 27 | + "listen to the album <album> by <artist>". |
| 28 | + --> |
| 29 | + <item name="pattern_listen_to_album_by_artist" type="string">écouter( l'album)? (.+) de (.+)</item> |
| 30 | + |
| 31 | + <item name="pattern_listen_to_album" type="string">écouter l'album (.+)</item> |
| 32 | + <item name="pattern_pause_playback" type="string">pause lecture</item> |
| 33 | + <item name="pattern_resume_playback" type="string">reprise lecture</item> |
| 34 | + <item name="pattern_stop_playback" type="string">arrêt lecture</item> |
| 35 | + |
| 36 | + <!-- |
| 37 | + The following are used in conjunction with the pattern_offset below. These should match the |
| 38 | + (hours?minutes?seconds?), with the addition of the ^ character (to indicate that in the matching |
| 39 | + pattern group starts with (hours or minutes or seconds). Unreliable behavior may result if |
| 40 | + these to not match the corresponding groups in pattern_offset. |
| 41 | + --> |
| 42 | + <item name="pattern_hours" type="string">^heures?</item> |
| 43 | + <item name="pattern_minutes" type="string">^minutes?</item> |
| 44 | + <item name="pattern_seconds" type="string">^secondes?</item> |
| 45 | + |
| 46 | + <!-- |
| 47 | + Offset pattern. This lets the user start with with "offset" or "timecode", followed by: |
| 48 | + any number followed by "hour(s)" or "minute(s)" or "second(s)", and optionally followed by: |
| 49 | + any number followed by "minute(s)" or "second(s)", and optionally followed by: |
| 50 | + any number followed by "second(s)" |
| 51 | + The ([0-9]+|two|to) pattern will most likely only need to be ([0-9]+) for other languages, as in English, |
| 52 | + the number 2 sounds the same as "to" and "two", so sometimes the Voice Recognition engine will confuse the |
| 53 | + number 2 with "to" or "two". If your language has numbers that sound exactly like other words that the |
| 54 | + Voice Recognition will sometimes mis-translate, please contact Chris Bellew as some further changes will need |
| 55 | + to be made to the code to accommodate this. |
| 56 | +
|
| 57 | + The (hours?|minutes?|seconds?) means hour, with or without an s at the end (singular or plural), and the |
| 58 | + same for minutes and seconds (the | means "or"). |
| 59 | + --> |
| 60 | + <item name="pattern_offset" type="string">^(position) ([0-9]+|de) (heures?|minutes?|secondes?)(?: ([0-9]+|de) (minutes?|secondes?))?(?: ([0-9]+|de) (secondes?))?</item> |
| 61 | +</resources> |
0 commit comments