C#

C# String NGram 분할

NuBiFoRM 2010. 8. 4. 15:59
static Array NGram(String src)
{
ArrayList result = new ArrayList();
for (int i = 0; i < src.Length; i++)
{
if (src.Length - i > 1)
{
for (int j = 0; j < i + 1; j++)
{
result.Add(src.Substring(j, src.Length - i));
}
}
}
return result.ToArray();
}