AssistantPlus/assistantexplorer/AssistantQueryHandler.m

30 lines
794 B
Mathematica
Raw Normal View History

2015-03-14 18:24:48 +00:00
//
// AssistantQueryHandler.m
//
//
// Created by Zaid Elkurdi on 3/7/15.
//
//
#import "AssistantQueryHandler.h"
@implementation AssistantQueryHandler
- (AssistantAction)handleQuery:(NSString*)query {
NSLog(@"Handling Query: %@", query);
query = [query lowercaseString];
// NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"" options:NSRegularExpressionCaseInsensitive error:nil];
if ([query rangeOfString:@"test"].location != NSNotFound) {
return AssistantChatAction;
} else if ([query rangeOfString:@"pause"].location != NSNotFound) {
return AssistantMusicPauseAction;
} else if ([query rangeOfString:@"play"].location != NSNotFound) {
return AssistantMusicPlayAction;
} else {
return AssistantDefaultAction;
}
}
@end