Post

Replies

Boosts

Views

Activity

How can I get Siri to recognize "43rd and Broadway"?
Hi all, This is a simplification of an AppIntent where I need my phrases to recognize three "regions" and a specific set of numbers associated with those regions. I am having trouble defining the AppEntity and associated AppShortcut phrases that works well with Siri, which is having trouble extracting numbers for some reason... Now the example: Imagine my app provides information surrounding Starbucks establishments on three major thoroughfares in NYC, such as: Broadway & 26, 40, 43, 54, 63, 75, 86, 95 Madison & 44, 50, 84, 96 Lexington & 43, 48, 55, 63, 67, 77, 85, 96 I need AppEntities, AppShortcuts, and friends that best work with Siri when launched with phrases such as: "Show 'example' for Madison and 50th in \(.applicationName)", "Show 'example' on 43rd and Broadway in \(.applicationName)", Long story short, Siri is picking up my phrases well, but then asking me to answer whether the value is 44, 50, 84, or 96, instead of just hearing that I said: "Madison and 50th" I've defined streets like this: public let nycStreetDisplayRepresentations: [DisplayRepresentation] = [ DisplayRepresentation(title: "26", synonyms: ["twenty six", "twenty sixth"]), DisplayRepresentation(title: "40", synonyms: ["forty", "fortieth"]), DisplayRepresentation(title: "43", synonyms: ["forty three", "forty third"]), DisplayRepresentation(title: "48", synonyms: ["forty eight", "forty eighth"]), DisplayRepresentation(title: "50", synonyms: ["fifty", "fiftieth"]), DisplayRepresentation(title: "54", synonyms: ["fifty four", "fifty fourth"]), DisplayRepresentation(title: "55", synonyms: ["fifty five", "fifty fifth", "five five"]), DisplayRepresentation(title: "63", synonyms: ["sixty three", "sixty third"]), DisplayRepresentation(title: "67", synonyms: ["sixty seven", "sixty seventh"]), DisplayRepresentation(title: "75", synonyms: ["seventy five", "seventy fifth"]), DisplayRepresentation(title: "77", synonyms: ["seventy seven", "seventy seventh", "seven seven"]), DisplayRepresentation(title: "84", synonyms: ["eighty four", "eighty fourth"]), DisplayRepresentation(title: "85", synonyms: ["eighty five", "eighty fifth"]), DisplayRepresentation(title: "86", synonyms: ["eighty six", "eighty sixth"]), DisplayRepresentation(title: "95", synonyms: ["ninety five", "ninety fifth"]), DisplayRepresentation(title: "96", synonyms: ["ninety six", "ninety sixth"]) ] And an entity like this: public struct MadisonThings: AppEntity, Identifiable { public let id: Int public var displayRepresentation: DisplayRepresentation { nycStreetDisplayRepresentations[id-1] } public static var typeDisplayRepresentation = TypeDisplayRepresentation( name: "Madison" , synonyms: ["Madison Ave"] ) public static var defaultQuery = MadisonTHingsQuery() } An EntityQuery: public struct MadisonThingsQuery: EntityQuery, EntityStringQuery { ...attempts to find synonyms in the phrase } Intent: public struct ShowMadisonThingsIntent: AppIntent { { @Parameter( title: "Street Number", description: "The street number (e.g., 5, 12, 44)" ) var streetNumber: MadisonThings // I have also tried just plain 'int' to no avail } And finally the shortcuts: static var appShortcuts: [AppShortcut] { return [ AppShortcut( intent: ShowMadisonThingsIntent(), phrases: [ "Show example for Madison and \(\.$streetNumber) in \(.applicationName)", "Show example on \(\.$streetNumber) in \(.applicationName)", ... This should be very simple, I think, and I've tried multiple ways of extracting numbers from my speech, but for some reason this is not working well at all. Thanks for your help!
3
0
92
5h
How can I get Siri to recognize "43rd and Broadway"?
Hi all, This is a simplification of an AppIntent where I need my phrases to recognize three "regions" and a specific set of numbers associated with those regions. I am having trouble defining the AppEntity and associated AppShortcut phrases that works well with Siri, which is having trouble extracting numbers for some reason... Now the example: Imagine my app provides information surrounding Starbucks establishments on three major thoroughfares in NYC, such as: Broadway & 26, 40, 43, 54, 63, 75, 86, 95 Madison & 44, 50, 84, 96 Lexington & 43, 48, 55, 63, 67, 77, 85, 96 I need AppEntities, AppShortcuts, and friends that best work with Siri when launched with phrases such as: "Show 'example' for Madison and 50th in \(.applicationName)", "Show 'example' on 43rd and Broadway in \(.applicationName)", Long story short, Siri is picking up my phrases well, but then asking me to answer whether the value is 44, 50, 84, or 96, instead of just hearing that I said: "Madison and 50th" I've defined streets like this: public let nycStreetDisplayRepresentations: [DisplayRepresentation] = [ DisplayRepresentation(title: "26", synonyms: ["twenty six", "twenty sixth"]), DisplayRepresentation(title: "40", synonyms: ["forty", "fortieth"]), DisplayRepresentation(title: "43", synonyms: ["forty three", "forty third"]), DisplayRepresentation(title: "48", synonyms: ["forty eight", "forty eighth"]), DisplayRepresentation(title: "50", synonyms: ["fifty", "fiftieth"]), DisplayRepresentation(title: "54", synonyms: ["fifty four", "fifty fourth"]), DisplayRepresentation(title: "55", synonyms: ["fifty five", "fifty fifth", "five five"]), DisplayRepresentation(title: "63", synonyms: ["sixty three", "sixty third"]), DisplayRepresentation(title: "67", synonyms: ["sixty seven", "sixty seventh"]), DisplayRepresentation(title: "75", synonyms: ["seventy five", "seventy fifth"]), DisplayRepresentation(title: "77", synonyms: ["seventy seven", "seventy seventh", "seven seven"]), DisplayRepresentation(title: "84", synonyms: ["eighty four", "eighty fourth"]), DisplayRepresentation(title: "85", synonyms: ["eighty five", "eighty fifth"]), DisplayRepresentation(title: "86", synonyms: ["eighty six", "eighty sixth"]), DisplayRepresentation(title: "95", synonyms: ["ninety five", "ninety fifth"]), DisplayRepresentation(title: "96", synonyms: ["ninety six", "ninety sixth"]) ] And an entity like this: public struct MadisonThings: AppEntity, Identifiable { public let id: Int public var displayRepresentation: DisplayRepresentation { nycStreetDisplayRepresentations[id-1] } public static var typeDisplayRepresentation = TypeDisplayRepresentation( name: "Madison" , synonyms: ["Madison Ave"] ) public static var defaultQuery = MadisonTHingsQuery() } An EntityQuery: public struct MadisonThingsQuery: EntityQuery, EntityStringQuery { ...attempts to find synonyms in the phrase } Intent: public struct ShowMadisonThingsIntent: AppIntent { { @Parameter( title: "Street Number", description: "The street number (e.g., 5, 12, 44)" ) var streetNumber: MadisonThings // I have also tried just plain 'int' to no avail } And finally the shortcuts: static var appShortcuts: [AppShortcut] { return [ AppShortcut( intent: ShowMadisonThingsIntent(), phrases: [ "Show example for Madison and \(\.$streetNumber) in \(.applicationName)", "Show example on \(\.$streetNumber) in \(.applicationName)", ... This should be very simple, I think, and I've tried multiple ways of extracting numbers from my speech, but for some reason this is not working well at all. Thanks for your help!
Replies
3
Boosts
0
Views
92
Activity
5h