-
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,614 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
36
samples/Stanford.NLP.CoreNLP.CSharp/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")] |
Oops, something went wrong.