mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
25 lines
542 B
C++
25 lines
542 B
C++
#include "TestData.h"
|
|
|
|
Vector<String> AliceWords()
|
|
{
|
|
Vector<String> w = Split(alice_text, [](int c) { return c > 32 ? 0 : c; });
|
|
Vector<String> r;
|
|
for(String s : w) {
|
|
s = ToLower(s);
|
|
int q = 0;
|
|
while(!IsAlNum(s[q]) && q < s.GetCount())
|
|
q++;
|
|
s = s.Mid(q);
|
|
while(s.GetCount() && !IsAlNum(*s.Last()))
|
|
s.TrimLast();
|
|
if(s.GetCount())
|
|
r.Add(s);
|
|
}
|
|
return r;
|
|
}
|
|
|
|
Vector<String> AliceLines()
|
|
{
|
|
Vector<String> s = Split(Filter(alice_text, [](int c) { return c == '\r' ? 0 : c; }), '\n');
|
|
return s;
|
|
}
|