Skip to content

Commit

Permalink
c# samples added as projects
Browse files Browse the repository at this point in the history
  • Loading branch information
volhav committed Oct 11, 2015
1 parent dbe091b commit b2dbb3a
Show file tree
Hide file tree
Showing 29 changed files with 1,614 additions and 3 deletions.
37 changes: 36 additions & 1 deletion Stanford.NLP.NET.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{A6A6AF7D-D6E3-442D-9B1E-58CC91879BE1}"
EndProject
Expand Down Expand Up @@ -62,6 +62,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{F354
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stanford.NLP.Parser.CSharp", "samples\Stanford.NLP.Parser.CSharp\Stanford.NLP.Parser.CSharp.csproj", "{C4ED4982-19EF-4BAB-A92D-91C572A9E4A8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stanford.NLP.CoreNLP.CSharp", "samples\Stanford.NLP.CoreNLP.CSharp\Stanford.NLP.CoreNLP.CSharp.csproj", "{0F34E183-4968-4269-9848-D907AFB6CB31}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stanford.NLP.NER.CSharp", "samples\Stanford.NLP.NER.CSharp\Stanford.NLP.NER.CSharp.csproj", "{4D9AF4ED-B531-4A80-BBEB-828101BD3F9D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stanford.NLP.POSTagger.CSharp", "samples\Stanford.NLP.POSTagger.CSharp\Stanford.NLP.POSTagger.CSharp.csproj", "{82549D93-4302-4F74-A23C-A0576705AC82}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stanford.NLP.Segmenter.CSharp", "samples\Stanford.NLP.Segmenter.CSharp\Stanford.NLP.Segmenter.CSharp.csproj", "{A07BC13B-AF0D-4A82-BC6B-F7C77040BBC8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stanford.NLP.SUTime.CSharp", "samples\Stanford.NLP.SUTime.CSharp\Stanford.NLP.SUTime.CSharp.csproj", "{82EEB2DD-C4C0-4414-B353-190F13716B2C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -92,6 +102,26 @@ Global
{C4ED4982-19EF-4BAB-A92D-91C572A9E4A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4ED4982-19EF-4BAB-A92D-91C572A9E4A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4ED4982-19EF-4BAB-A92D-91C572A9E4A8}.Release|Any CPU.Build.0 = Release|Any CPU
{0F34E183-4968-4269-9848-D907AFB6CB31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F34E183-4968-4269-9848-D907AFB6CB31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F34E183-4968-4269-9848-D907AFB6CB31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F34E183-4968-4269-9848-D907AFB6CB31}.Release|Any CPU.Build.0 = Release|Any CPU
{4D9AF4ED-B531-4A80-BBEB-828101BD3F9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D9AF4ED-B531-4A80-BBEB-828101BD3F9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D9AF4ED-B531-4A80-BBEB-828101BD3F9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D9AF4ED-B531-4A80-BBEB-828101BD3F9D}.Release|Any CPU.Build.0 = Release|Any CPU
{82549D93-4302-4F74-A23C-A0576705AC82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{82549D93-4302-4F74-A23C-A0576705AC82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{82549D93-4302-4F74-A23C-A0576705AC82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{82549D93-4302-4F74-A23C-A0576705AC82}.Release|Any CPU.Build.0 = Release|Any CPU
{A07BC13B-AF0D-4A82-BC6B-F7C77040BBC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A07BC13B-AF0D-4A82-BC6B-F7C77040BBC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A07BC13B-AF0D-4A82-BC6B-F7C77040BBC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A07BC13B-AF0D-4A82-BC6B-F7C77040BBC8}.Release|Any CPU.Build.0 = Release|Any CPU
{82EEB2DD-C4C0-4414-B353-190F13716B2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{82EEB2DD-C4C0-4414-B353-190F13716B2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{82EEB2DD-C4C0-4414-B353-190F13716B2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{82EEB2DD-C4C0-4414-B353-190F13716B2C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -106,5 +136,10 @@ Global
{AB3F38DD-6280-495F-8D29-752BB4AD1EAB} = {ED8079DD-2B06-4030-9F0F-DC548F98E1C4}
{DB60FB5A-0452-4AC1-B682-E67065419978} = {ED8079DD-2B06-4030-9F0F-DC548F98E1C4}
{C4ED4982-19EF-4BAB-A92D-91C572A9E4A8} = {F3548FA9-EC99-422B-825A-37CB9CF4C74B}
{0F34E183-4968-4269-9848-D907AFB6CB31} = {F3548FA9-EC99-422B-825A-37CB9CF4C74B}
{4D9AF4ED-B531-4A80-BBEB-828101BD3F9D} = {F3548FA9-EC99-422B-825A-37CB9CF4C74B}
{82549D93-4302-4F74-A23C-A0576705AC82} = {F3548FA9-EC99-422B-825A-37CB9CF4C74B}
{A07BC13B-AF0D-4A82-BC6B-F7C77040BBC8} = {F3548FA9-EC99-422B-825A-37CB9CF4C74B}
{82EEB2DD-C4C0-4414-B353-190F13716B2C} = {F3548FA9-EC99-422B-825A-37CB9CF4C74B}
EndGlobalSection
EndGlobal
7 changes: 6 additions & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ http http://nlp.stanford.edu/software/stanford-corenlp-full-2015-04-20.zip
http http://nlp.stanford.edu/software/stanford-ner-2015-04-20.zip
http http://nlp.stanford.edu/software/stanford-parser-full-2015-04-20.zip
http http://nlp.stanford.edu/software/stanford-postagger-full-2015-04-20.zip
http http://nlp.stanford.edu/software/stanford-segmenter-2015-04-20.zip
http http://nlp.stanford.edu/software/stanford-segmenter-2015-04-20.zip

nuget Stanford.NLP.CoreNLP
nuget Stanford.NLP.NER
nuget Stanford.NLP.POSTagger
nuget Stanford.NLP.Segmenter
10 changes: 9 additions & 1 deletion paket.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NUGET
remote: https://nuget.org/api/v2
specs:
FAKE (4.4.6)
FAKE (4.5.3)
FSharp.Compiler.Service (0.0.90)
FSharp.Formatting (2.11.0)
FSharp.Compiler.Service (>= 0.0.90 <= 1.3)
Expand All @@ -15,6 +15,14 @@ NUGET
NuGet.CommandLine (2.8.6)
NUnit (2.6.3)
NUnit.Runners (2.6.3)
Stanford.NLP.CoreNLP (3.5.2.1)
IKVM (8.1.5717)
Stanford.NLP.NER (3.5.2.1)
IKVM (8.1.5717)
Stanford.NLP.POSTagger (3.5.2.1)
IKVM (8.1.5717)
Stanford.NLP.Segmenter (3.5.2.1)
IKVM (8.1.5717)
HTTP
remote: http://www.frijters.net
specs:
Expand Down
52 changes: 52 additions & 0 deletions samples/Stanford.NLP.CSharp.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stanford.NLP.CoreNLP.CSharp", "Stanford.NLP.CoreNLP.CSharp\Stanford.NLP.CoreNLP.CSharp.csproj", "{0F34E183-4968-4269-9848-D907AFB6CB31}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stanford.NLP.NER.CSharp", "Stanford.NLP.NER.CSharp\Stanford.NLP.NER.CSharp.csproj", "{4D9AF4ED-B531-4A80-BBEB-828101BD3F9D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stanford.NLP.Parser.CSharp", "Stanford.NLP.Parser.CSharp\Stanford.NLP.Parser.CSharp.csproj", "{C4ED4982-19EF-4BAB-A92D-91C572A9E4A8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stanford.NLP.POSTagger.CSharp", "Stanford.NLP.POSTagger.CSharp\Stanford.NLP.POSTagger.CSharp.csproj", "{82549D93-4302-4F74-A23C-A0576705AC82}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stanford.NLP.Segmenter.CSharp", "Stanford.NLP.Segmenter.CSharp\Stanford.NLP.Segmenter.CSharp.csproj", "{A07BC13B-AF0D-4A82-BC6B-F7C77040BBC8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stanford.NLP.SUTime.CSharp", "Stanford.NLP.SUTime.CSharp\Stanford.NLP.SUTime.CSharp.csproj", "{82EEB2DD-C4C0-4414-B353-190F13716B2C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0F34E183-4968-4269-9848-D907AFB6CB31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F34E183-4968-4269-9848-D907AFB6CB31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F34E183-4968-4269-9848-D907AFB6CB31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F34E183-4968-4269-9848-D907AFB6CB31}.Release|Any CPU.Build.0 = Release|Any CPU
{4D9AF4ED-B531-4A80-BBEB-828101BD3F9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D9AF4ED-B531-4A80-BBEB-828101BD3F9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D9AF4ED-B531-4A80-BBEB-828101BD3F9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D9AF4ED-B531-4A80-BBEB-828101BD3F9D}.Release|Any CPU.Build.0 = Release|Any CPU
{C4ED4982-19EF-4BAB-A92D-91C572A9E4A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C4ED4982-19EF-4BAB-A92D-91C572A9E4A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4ED4982-19EF-4BAB-A92D-91C572A9E4A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4ED4982-19EF-4BAB-A92D-91C572A9E4A8}.Release|Any CPU.Build.0 = Release|Any CPU
{82549D93-4302-4F74-A23C-A0576705AC82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{82549D93-4302-4F74-A23C-A0576705AC82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{82549D93-4302-4F74-A23C-A0576705AC82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{82549D93-4302-4F74-A23C-A0576705AC82}.Release|Any CPU.Build.0 = Release|Any CPU
{A07BC13B-AF0D-4A82-BC6B-F7C77040BBC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A07BC13B-AF0D-4A82-BC6B-F7C77040BBC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A07BC13B-AF0D-4A82-BC6B-F7C77040BBC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A07BC13B-AF0D-4A82-BC6B-F7C77040BBC8}.Release|Any CPU.Build.0 = Release|Any CPU
{82EEB2DD-C4C0-4414-B353-190F13716B2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{82EEB2DD-C4C0-4414-B353-190F13716B2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{82EEB2DD-C4C0-4414-B353-190F13716B2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{82EEB2DD-C4C0-4414-B353-190F13716B2C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions samples/Stanford.NLP.CoreNLP.CSharp/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
44 changes: 44 additions & 0 deletions samples/Stanford.NLP.CoreNLP.CSharp/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
using System.IO;
using java.util;
using java.io;
using edu.stanford.nlp.pipeline;
using Console = System.Console;

namespace Stanford.NLP.CoreNLP.CSharp
{
class Program
{
static void Main()
{
// Path to the folder with models extracted from `stanford-parser-3.5.2-models.jar`
var jarRoot = @"..\..\..\..\paket-files\nlp.stanford.edu\stanford-corenlp-full-2015-04-20\models";

// Text for processing
var text = "Kosgi Santosh sent an email to Stanford University. He didn't get a reply.";

// Annotation pipeline configuration
var props = new Properties();
props.setProperty("annotators", "tokenize, ssplit, pos, lemma, parse");//ner fails -> dcoref depends on ner
props.setProperty("sutime.binders", "0");

// We should change current directory, so StanfordCoreNLP could find all the model files automatically
var curDir = Environment.CurrentDirectory;
Directory.SetCurrentDirectory(jarRoot);
var pipeline = new StanfordCoreNLP(props);
Directory.SetCurrentDirectory(curDir);

// Annotation
var annotation = new Annotation(text);
pipeline.annotate(annotation);

// Result - Pretty Print
using (var stream = new ByteArrayOutputStream())
{
pipeline.prettyPrint(annotation, new PrintWriter(stream));
Console.WriteLine(stream.toString());
stream.close();
}
}
}
}
36 changes: 36 additions & 0 deletions samples/Stanford.NLP.CoreNLP.CSharp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Stanford.NLP.CoreNLP.CSharp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("cStanford.NLP.CoreNLP.CSharp")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0a0f46f8-cd64-43e8-891e-e2e5303e4243")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading

0 comments on commit b2dbb3a

Please sign in to comment.