本文整理匯總了C#中Analyzer.Count方法的典型用法代碼示例。如果您正苦於以下問題:C# Analyzer.Count方法的具體用法?C# Analyzer.Count怎麽用?C# Analyzer.Count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Analyzer
的用法示例。
在下文中一共展示了Analyzer.Count方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Main
public static void Main(string[] args)
{
string inputname = args[0];
string outputname = args[1];
string[] lines = File.ReadAllLines(inputname);
int ncases = int.Parse(lines[0]);
int nline = 0;
IList<string> results = new List<string>();
Analyzer analyzer = new Analyzer();
for (int k = 0; k < ncases; k++)
{
Console.WriteLine(string.Format("Solving Case #{0}", k + 1));
nline++;
string[] words = lines[nline].Split(' ');
string text = words[0];
int length = int.Parse(words[1]);
int count = analyzer.Count(text, length);
results.Add(string.Format("Case #{0}: {1}", k + 1, count));
}
File.WriteAllLines(outputname, results.ToArray());
}
示例2: GetCountGcjLength2
public void GetCountGcjLength2()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(3, analyzer.Count("gcj", 2));
}
示例3: GetCountQuartzLength2
public void GetCountQuartzLength2()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(9, analyzer.Count("quartz", 2));
}
示例4: GetCountAbeLength1
public void GetCountAbeLength1()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(4, analyzer.Count("abe", 1));
}
示例5: GetCountAaaaLength3
public void GetCountAaaaLength3()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(0, analyzer.Count("aaaa", 3));
}
示例6: GetCountTsetseLength2
public void GetCountTsetseLength2()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(11, analyzer.Count("tsetse", 2));
}
示例7: GetCountStringLength3
public void GetCountStringLength3()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(4, analyzer.Count("string", 3));
}
示例8: GetCountStraightLength3
public void GetCountStraightLength3()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(11, analyzer.Count("straight", 3));
}