Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public unsafe static string[] PreProcessBook(string Input, int *MaximumLength)
- {
- *MaximumLength = 0;
- HashSet<string> Output = new HashSet<string>();
- StringBuilder builder = new StringBuilder(50);
- foreach (char c in Input)
- {
- if (c == '\r' || c == '\n' || c == ' ')
- {
- string Word = builder.ToString();
- if (Word.Length > 0)
- {
- Output.Add(Word);
- if (Word.Length > *MaximumLength)
- *MaximumLength = Word.Length;
- }
- builder.Clear();
- }
- else if (c >= 'A' && c <= 'Z' || c == 'Ä' || c == 'Ö' || c == 'Å')
- {
- builder.Append((char)(c + 32));
- }
- else
- {
- builder.Append(c);
- }
- }
- return Output.ToArray();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement