단어 줄기를 사용하여 NSLinguisticTagger
을 사용하고 있습니다. 나는 한 마디로 줄기 단어를 얻을 수 있지만 한 마디에 줄기 단어를 얻을 수는 없다. iOS에서 단어 줄기 사용 - 단일 단어로 작동하지 않음
다음
은 내가 사용하고있는 코드, 나는대로 올바르게 얻고이를 위해NSString *stmnt = @"i waited";
NSLinguisticTaggerOptions options = NSLinguisticTaggerOmitWhitespace | NSLinguisticTaggerOmitPunctuation | NSLinguisticTaggerJoinNames;
NSLinguisticTagger *tagger = [[NSLinguisticTagger alloc] initWithTagSchemes:@[NSLinguisticTagSchemeLemma] options:options];
tagger.string = stmnt;
[tagger enumerateTagsInRange:NSMakeRange(0, [stmnt length]) scheme:NSLinguisticTagSchemeLemma options:options usingBlock:^(NSString *tag, NSRange tokenRange, NSRange sentenceRange, BOOL *stop) {
NSString *token = [stmnt substringWithRange:tokenRange];
NSLog(@"%@: %@", token, tag);
}];
입니다 :
i: i
waited: wait
그러나 위의 코드는 줄기 단어를 식별하는 데 실패 stmnt = @"waited";
경우 어떤 도움을 크게 환영합니다
언어에 해당 단어가 포함되어 있지 않으면 악의적 인 액세스 권한을 제공합니다. 예를 들어 'abcd'로 시도해보십시오. 나는 그것을 신속히 사용하려고 노력하고있다. 어떤 생각? –
나쁜 접근 권한을 부여합니다. 내가 뭘 잘못하고 있는지 모르겠다. – Vojto
https://stackoverflow.com/questions/48768919/device-vs-simulator-linguistic-schemes 여기에서 도움을 주시겠습니까? 같은 장치가 작동하지 않는 물리적 장치 : \ –