Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<string[]> threeGrams = new List<string[]>();
- int wordCount = nonEmptyWords.Count;
- for (int i = 0; i < wordCount - 2; i++)
- {
- string[] threeGram = new string[3];
- for (int j = 0; j < 3; j++)
- {
- threeGram[j] = nonEmptyWords[i + j];
- }
- threeGrams.Add(threeGram);
- }
- threeGrams.Add(new[] { nonEmptyWords[wordCount - 2], nonEmptyWords[wordCount - 1]});
- threeGrams.Add(new[] { nonEmptyWords[wordCount - 1] });
- foreach (string[] threeGram in threeGrams)
- {
- output.Set("MeetingId", meetingId);
- output.Set("SubjectThreeGramWord1", threeGram[0]);
- if (threeGram.Length >= 2)
- {
- output.Set("SubjectThreeGramWord2", threeGram[1]);
- }
- else
- {
- output.Set<string>("SubjectThreeGramWord2", null);
- }
- if (threeGram.Length >= 3)
- {
- output.Set<string>("SubjectThreeGramWord3", threeGram[2]);
- }
- else
- {
- output.Set<string>("SubjectThreeGramWord3", null);
- }
- yield return output.AsReadOnly();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement