Skip to content

Commit

Permalink
Updated the testprogram
Browse files Browse the repository at this point in the history
  • Loading branch information
Fredrik Stigsson committed Oct 27, 2014
1 parent a3d0bd3 commit ae59ff5
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 1,925 deletions.
4 changes: 2 additions & 2 deletions TestProgram/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
[assembly: AssemblyTitle("TestProgram")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("A Name Not Yet Taken AB")]
[assembly: AssemblyProduct("TestProgram")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
42 changes: 0 additions & 42 deletions TestProgram/StemmerTest.cs

This file was deleted.

14 changes: 5 additions & 9 deletions TestProgram/TestProgram.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0F6BCEF7-1F70-4A1D-B1B5-98D2CD1B2FD9}</ProjectGuid>
<OutputType>WinExe</OutputType>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TestProgram</RootNamespace>
<AssemblyName>TestProgram</AssemblyName>
Expand Down Expand Up @@ -56,18 +56,16 @@
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="StemmerTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestStemmers.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Stemmer\Stemmer.csproj">
<Project>{4c09cbab-760a-44a3-8084-37f07f121e70}</Project>
<Name>Stemmer</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<ItemGroup />
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
Expand All @@ -89,10 +87,8 @@
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>REM Create a NuGet package for this project and place the .nupkg file in the project's output directory.
REM If you see this in Visual Studio's Error List window, check the Output window's Build tab for the actual error.
ECHO Creating NuGet package in Post-Build event...
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "&amp; '$(ProjectDir)_CreateNewNuGetPackage\DoNotModify\CreateNuGetPackage.ps1' -ProjectFilePath '$(ProjectPath)' -OutputDirectory '$(TargetDir)' -BuildConfiguration '$(ConfigurationName)' -BuildPlatform '$(PlatformName)'"</PostBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
68 changes: 68 additions & 0 deletions TestProgram/TestStemmers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Annytab;

namespace TestProgram
{
[TestClass]
public class TestStemmers
{
[TestMethod]
public void TestSwedishStemmer()
{
// Create an array with words to test
string[] words = new string[] {"klo", "kloaken", "klock", "klocka", "klockan", "klockans", "klockare", "klockaren", "klockarens",
"klockarfar", "klockarn", "klockarsonen", "klockas", "klockkedjan", "klocklikt", "klockor", "klockorna", "klok", "kloka",
"klokare", "klokast", "klokaste", "kloke", "klokhet", "klokheten", "bilar", "bilarna", "bilen", "Bilens", "Semesterlagen",
"Ansvarslöst", "Ansvarsfullt", "RAKARE", "JAPANSKA", "Mallen", "1990", "Och", "Utan"};

// Create an array with correct steams
string[] steams = new string[] {"klo", "kloak", "klock", "klock", "klockan", "klockan", "klock", "klock", "klock",
"klockarf", "klockarn", "klockarson", "klock", "klockkedjan", "klocklik", "klock", "klock", "klok", "klok",
"klok", "klok", "klok", "klok", "klok", "klok", "bil", "bil", "bil", "Bil", "Semesterlag",
"Ansvarslös", "Ansvarsfull", "RAK", "JAPANSK", "Mall", "1990", "Och", "Utan"};

// Create a swedish stemmer
Stemmer stemmer = new SwedishStemmer();

// Test the stemmer
for(int i = 0; i < words.Length; i++)
{
Assert.AreEqual(steams[i], stemmer.GetSteamWord(words[i]));
}

} // End of the TestSwedishStemmer method

[TestMethod]
public void TestEnglishStemmer()
{
// Create an array with words to test
string[] words = new string[] { "consign", "consigned", "consigning", "consignment", "consist", "consisted", "consistency", "consistent", "consistently",
"consisting", "consists", "consolation", "consolations", "consolatory", "console", "consoled", "consoles", "consolidate", "consolidated", "consolidating",
"consoling", "consolingly", "consols", "consonant", "consort", "consorted", "consorting", "conspicuous", "conspicuously",
"conspiracy", "conspirator", "conspirators", "conspire", "conspired", "conspiring", "constable", "constables", "constance", "constancy", "constant",
"knack", "knackeries", "knacks", "knag", "knave", "knaves", "knavish", "kneaded", "kneading", "knee", "kneel", "kneeled", "kneeling", "kneels",
"knees", "knell", "knelt", "templates", "cry", "Sky", "absolutely"};

// Create an array with correct steams
string[] steams = new string[] { "consign", "consign", "consign", "consign", "consist", "consist", "consist", "consist", "consist",
"consist", "consist", "consol", "consol", "consol", "consol", "consol", "consol", "consolid", "consolid", "consolid",
"consol", "consol", "consol", "conson", "consort", "consort", "consort", "conspicu", "conspicu",
"conspir", "conspir", "conspir", "conspir", "conspir", "conspir", "constabl", "constabl", "constanc", "constanc", "constant",
"knack", "knackeri", "knack", "knag", "knav", "knav", "knavish", "knead", "knead", "knee", "kneel", "kneel", "kneel", "kneel",
"knee", "knell", "knelt", "templat", "cri", "sky", "absolut"};

// Create a english stemmer
Stemmer stemmer = new EnglishStemmer();

// Test the stemmer
for (int i = 0; i < words.Length; i++)
{
Assert.AreEqual(steams[i], stemmer.GetSteamWord(words[i]));
}

} // End of the TestEnglishStemmer method

} // End of the class

} // End of the namespace
3 changes: 0 additions & 3 deletions TestProgram/app.config

This file was deleted.

Binary file not shown.

This file was deleted.

Loading

0 comments on commit ae59ff5

Please sign in to comment.