Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyzwezdin committed Jul 2, 2016
0 parents commit b0dc4a5
Show file tree
Hide file tree
Showing 25 changed files with 1,226 additions and 0 deletions.
194 changes: 194 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/

# Visual Studo 2015 cache/options directory
.vs/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding addin-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config

# Windows Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
*.[Cc]ache
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
bower_components/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt
28 changes: 28 additions & 0 deletions Pretzel.SimilarPosts.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pretzel.SimilarPosts", "Pretzel.SimilarPosts\Pretzel.SimilarPosts.csproj", "{B740C151-3692-4965-AB32-5557F8E50A88}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pretzel.Logic", "..\pretzel\src\Pretzel.Logic\Pretzel.Logic.csproj", "{F2E6664D-75AC-4830-8A55-E572027DF710}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B740C151-3692-4965-AB32-5557F8E50A88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B740C151-3692-4965-AB32-5557F8E50A88}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B740C151-3692-4965-AB32-5557F8E50A88}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B740C151-3692-4965-AB32-5557F8E50A88}.Release|Any CPU.Build.0 = Release|Any CPU
{F2E6664D-75AC-4830-8A55-E572027DF710}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2E6664D-75AC-4830-8A55-E572027DF710}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2E6664D-75AC-4830-8A55-E572027DF710}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2E6664D-75AC-4830-8A55-E572027DF710}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
10 changes: 10 additions & 0 deletions Pretzel.SimilarPosts/Api/IComparision.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Collections.Generic;
using Pretzel.Logic.Templating.Context;

namespace Pretzel.SimilarPosts.Api
{
public interface IComparision
{
double Compare(IList<Page> allDocuments, string name1, string name2, TextVector document1, TextVector document2);
}
}
14 changes: 14 additions & 0 deletions Pretzel.SimilarPosts/Api/IComparisionMatrixGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Pretzel.Logic.Templating.Context;

namespace Pretzel.SimilarPosts.Api
{
public interface IComparisionMatrixGenerator
{
Dictionary<string, Dictionary<string, double>> Generate(IDictionary<string, string[]> words, IList<Page> documents);
}
}
9 changes: 9 additions & 0 deletions Pretzel.SimilarPosts/Api/IContentParser.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System.Collections.Generic;

namespace Pretzel.SimilarPosts.Api
{
public interface IContentParser
{
IDictionary<string, string> Parse(string[] files, ISourceCleanup[] sourceCleanups);
}
}
7 changes: 7 additions & 0 deletions Pretzel.SimilarPosts/Api/ISourceCleanup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Pretzel.SimilarPosts.Api
{
public interface ISourceCleanup
{
string Cleanup(string source);
}
}
7 changes: 7 additions & 0 deletions Pretzel.SimilarPosts/Api/IWordCleanup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Pretzel.SimilarPosts.Api
{
public interface IWordCleanup
{
string Cleanup(string source);
}
}
35 changes: 35 additions & 0 deletions Pretzel.SimilarPosts/Api/TextVector.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;

namespace Pretzel.SimilarPosts.Api
{
public class TextVector : Dictionary<string, double>
{
public TextVector()
{
}

public TextVector(Dictionary<string, double> source)
: base(source)
{
}
}

public static class TextVectorExtensions
{
public static TextVector ToTextVector<T>(this IEnumerable<T> source, Func<T, string> keySelector, Func<T, double> elementSelector)
{
if (source == null)
return null;

TextVector result = new TextVector();

foreach (var item in source)
{
result.Add(keySelector(item), elementSelector(item));
}

return result;
}
}
}
Loading

0 comments on commit b0dc4a5

Please sign in to comment.