Skip to content

Instantly share code, notes, and snippets.

View peteburtis's full-sized avatar

Pete Burtis peteburtis

View GitHub Profile
@dasdom
dasdom / DDHLanguageDetection.m
Last active August 23, 2018 14:39
Language detection in iOS. This code is used to add the language to a post in my ADN client hAppy. This is pubic domain. To with it what every you like!
NSString *languageGuessedString;
if (postString.length < 60) {
languageGuessedString = nil;
} else {
NSArray *componentsArray = [postString componentsSeparatedByString:@" "];
NSMutableString *mutablePostString = [NSMutableString string];
for (NSString *string in componentsArray) {
if ([string rangeOfString:@"@"].location != NSNotFound) {
continue;