コード例 #1
0
ファイル: palindrome.c プロジェクト: joubin/CodeGymnastics
main(){
	char xx[] = "DOD stands for hello. this isn't for fun";
	//printf("Original array: %s\n", xx);
	removeSpaces(xx);
	removePunctuation(xx);
	findPalindrome(xx);
	//printf("Redone array: %s\n", xx);
}
コード例 #2
0
ファイル: TokenizerRus.cpp プロジェクト: Samsung/veles.nlp
vector<Token> TokenizerRus::Tokenize(
		const wstring& sentence) const
{
    wstring replaced = replaceSpecialSymbols(sentence);
    wstring alignedSentence = alignSentence(replaced);
    wstring correctedSentece = applyMultipleTokensRule(alignedSentence);
    vector<wstring> splitted = Tools::Split(correctedSentece, L" ", L"\u00A0", L"\t");
    vector<Token> tokens;
    for (size_t splittedIndex = 0; splittedIndex < splitted.size();
        ++splittedIndex)
    {
        wstring current = splitted[splittedIndex];
        vector<wstring> punctuation;
        removePunctuation(&current, &punctuation);
        Token token(current, punctuation);
        tokens.push_back(token);
    }
    applyFirstSymbolPunctuationRule(&tokens);
    return tokens;
}