Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

Commit 64c6c65

Browse files
committed
Initial Commit for the C# SDK
0 parents  commit 64c6c65

39 files changed

+4351
-0
lines changed

ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CHANGELOG
2+
3+
0.8 - Added support for author extraction and targeted sentiment analysis.
4+
0.7 - Added support for relations extraction.
5+
0.6 - Added support for sentiment analysis, fixed time delay bug in
6+
HTTP POST calls.
7+
0.5 - Added GetRankedConcepts calls, parameters objects.
8+
0.4 - Added GetRankedKeywords calls, added TextGetCategory call.
9+
0.3 - Added ConstraintQuery API call, general improvements.
10+
0.2 - Added setApiKey() call, setApiHost() call, updated API endpoint.
11+
0.1 - Initial Release

README

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
================================
2+
AlchemyAPI .NET SDK: version 0.8
3+
================================
4+
5+
This is a .NET (C#) implementation of the AlchemyAPI SDK. Mono and .NET
6+
sections for installation and examples are below. AlchemyAPI keys
7+
can be downloaded from alchemyapi.com
8+
9+
================================
10+
MONO
11+
================================
12+
13+
INSTALLATION
14+
15+
To compile this module, enter the "module" directory and run the "build.sh"
16+
script.
17+
18+
To install this module, copy the AlchemyAPI.dll file into your desired
19+
.NET import directory, or set your MONO_PATH environment variable to point
20+
to the directory containing the compiled AlchemyAPI.dll file.
21+
22+
23+
RUNNING EXAMPLES
24+
25+
Several code examples are included to illustrate using the AlchemyAPI
26+
for named entity extraction, text classification, language identification,
27+
and other tasks.
28+
29+
All code samples are within the "example" directory.
30+
31+
To run these code samples you must first edit the (example/api_key.txt) file,
32+
adding your assigned Orchestr8 API key.
33+
34+
Compiling Code Samples:
35+
36+
1. Run "build.sh" (Compiles code using Mono)
37+
38+
Running Code Samples:
39+
40+
1. Entity Extraction: ./run-test.sh entities.exe
41+
42+
2. Concept Tagging: ./run-test.sh concepts.exe
43+
44+
3. Keyword Extraction: ./run-test.sh keywords.exe
45+
46+
4. Text Categorization: ./run-test.sh categories.exe
47+
48+
5. Language Identification: ./run-test.sh language.exe
49+
50+
6. HTML Text Extraction: ./run-test.sh text_extract.exe
51+
52+
7. HTML Structured Content Scraping: ./run-test.sh constraint_queries.exe
53+
54+
8. Microformats Extraction: ./run-test.sh microformats.exe
55+
56+
9. RSS / ATOM Feed Links Extraction: ./run-test.sh feed_links.exe
57+
58+
10. Sentiment Analysis: ./run-test.sh sentiment.exe
59+
60+
11. Relations Extraction: ./run-test.sh relations.exe
61+
62+
12. Example Parameter Usage: ./run-test.sh parameters.exe
63+
64+
13. Author Extraction ./run-test.sh author.exe
65+
66+
67+
================================
68+
Windows .NET
69+
================================
70+
71+
INSTALLATION
72+
73+
To compile this module, enter the "module" directory and run the "build"
74+
script.
75+
76+
To install this module, copy the AlchemyAPI.dll file into your desired
77+
.NET import directory. For purposes of running examples, the dll is
78+
copied into the example folder.
79+
80+
RUNNING EXAMPLES
81+
82+
Several code examples are included to illustrate using the AlchemyAPI
83+
for named entity extraction, text classification, language identification,
84+
and other tasks.
85+
86+
All code samples are within the "example" directory.
87+
88+
To run these code samples you must first edit the (example/api_key.txt) file,
89+
adding your assigned Orchestr8 API key.
90+
91+
Compiling Code Samples:
92+
93+
1. Run "build" (Compiles code using .NET)
94+
95+
Running Code Samples:
96+
97+
1. Entity Extraction: entities.exe
98+
99+
2. Concept Tagging: concepts.exe
100+
101+
3. Keyword Extraction: keywords.exe
102+
103+
4. Text Categorization: categories.exe
104+
105+
5. Language Identification: language.exe
106+
107+
6. HTML Text Extraction: text_extract.exe
108+
109+
7. HTML Structured Content Scraping: constraint_queries.exe
110+
111+
8. Microformats Extraction: microformats.exe
112+
113+
9. RSS / ATOM Feed Links Extraction: feed_links.exe
114+
115+
10. Setiment Analysis: sentiment.exe
116+
117+
11. Relations Extraction: relations.exe
118+
119+
12. Example Parameter Usage: parameters.exe
120+
121+
13. Author Extraction: authors.exe
122+
123+
124+
DEPENDENCIES
125+
126+
This module requires a C# compiler such as Mono or Microsoft Visual Studio.NET
127+
128+
The included "build.sh" is for use with the Mono C# compiler only.
129+
130+
131+
COPYRIGHT AND LICENCE
132+
133+
Copyright (C) 2009-2012 Orchestr8, LLC.
134+
135+
This library is free software; you can redistribute it and/or modify
136+
it under the same terms as Mono itself, either Mono version 2.2 or,
137+
at your option, any later version of Mono 2.2 you may have available.
138+
139+

example/README

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
================================
2+
AlchemyAPI .NET SDK: version 0.8
3+
================================
4+
5+
This is a .NET (C#) implementation of the AlchemyAPI SDK. Mono and .NET
6+
sections for installation and examples are below. AlchemyAPI requires an
7+
API key for proper usage. You may create an API key at www.alchemyapi.com.
8+
9+
10+
================================
11+
MONO
12+
================================
13+
14+
INSTALLATION
15+
16+
To compile this module, enter the "module" directory and run the "build.sh"
17+
script.
18+
19+
To install this module, copy the AlchemyAPI.dll file into your desired
20+
.NET import directory, or set your MONO_PATH environment variable to point
21+
to the directory containing the compiled AlchemyAPI.dll file.
22+
23+
24+
RUNNING EXAMPLES
25+
26+
Several code examples are included to illustrate using the AlchemyAPI
27+
for named entity extraction, text classification, language identification,
28+
and other tasks.
29+
30+
All code samples are within the "example" directory.
31+
32+
To run these code samples you must first edit the (example/api_key.txt) file,
33+
adding your assigned Orchestr8 API key.
34+
35+
Compiling Code Samples:
36+
37+
1. Run "build.sh" (Compiles code using Mono)
38+
39+
Running Code Samples:
40+
41+
1. Entity Extraction: ./run-test.sh entities.exe
42+
43+
2. Concept Tagging: ./run-test.sh concepts.exe
44+
45+
3. Keyword Extraction: ./run-test.sh keywords.exe
46+
47+
4. Text Categorization: ./run-test.sh categories.exe
48+
49+
5. Language Identification: ./run-test.sh language.exe
50+
51+
6. HTML Text Extraction: ./run-test.sh text_extract.exe
52+
53+
7. HTML Structured Content Scraping: ./run-test.sh constraint_queries.exe
54+
55+
8. Microformats Extraction: ./run-test.sh microformats.exe
56+
57+
9. RSS / ATOM Feed Links Extraction: ./run-test.sh feed_links.exe
58+
59+
10. Sentiment Analysis: ./run-test.sh sentiment.exe
60+
61+
11. Relations Extraction: ./run-test.sh relations.exe
62+
63+
12. Example Parameter Usage: ./run-test.sh parameters.exe
64+
65+
13. Author Extraction: ./run-test.sh author.exe
66+
67+
================================
68+
Windows .NET
69+
================================
70+
71+
INSTALLATION
72+
73+
To compile this module, enter the "module" directory and run the "build"
74+
script.
75+
76+
To install this module, copy the AlchemyAPI.dll file into your desired
77+
.NET import directory. For purposes of running examples, the dll is
78+
copied into the example folder.
79+
80+
81+
RUNNING EXAMPLES
82+
83+
Several code examples are included to illustrate using the AlchemyAPI
84+
for named entity extraction, text classification, language identification,
85+
and other tasks.
86+
87+
All code samples are within the "example" directory.
88+
89+
To run these code samples you must first edit the (example/api_key.txt) file,
90+
adding your assigned Orchestr8 API key.
91+
92+
Compiling Code Samples:
93+
94+
1. Run "build" (Compiles code using .NET)
95+
96+
Running Code Samples:
97+
98+
1. Entity Extraction: entities.exe
99+
100+
2. Concept Tagging: concepts.exe
101+
102+
3. Keyword Extraction: keywords.exe
103+
104+
4. Text Categorization: categories.exe
105+
106+
5. Language Identification: language.exe
107+
108+
6. HTML Text Extraction: text_extract.exe
109+
110+
7. HTML Structured Content Scraping: constraint_queries.exe
111+
112+
8. Microformats Extraction: microformats.exe
113+
114+
9. RSS / ATOM Feed Links Extraction: feed_links.exe
115+
116+
10. Sentiment Analysis: sentiment.exe
117+
118+
11. Relations Extraction: relations.exe
119+
120+
12. Example Parameter Usage: parameters.exe
121+
122+
13. Author Extraction: author.exe
123+
124+
DEPENDENCIES
125+
126+
This module requires a C# compiler such as Mono or Microsoft Visual Studio.NET
127+
128+
The included "build.sh" is for use with the Mono C# compiler only.
129+
130+
131+
COPYRIGHT AND LICENCE
132+
133+
Copyright (C) 2009-2011 Orchestr8, LLC.
134+
135+
This library is free software; you can redistribute it and/or modify
136+
it under the same terms as Mono itself, either Mono version 2.2 or,
137+
at your option, any later version of Mono 2.2 you may have available.
138+
139+

example/author.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
using System;
3+
using System.IO;
4+
using AlchemyAPI;
5+
6+
7+
public class TestApp
8+
{
9+
static public void Main ()
10+
{
11+
// Create an AlchemyAPI object.
12+
AlchemyAPI.AlchemyAPI alchemyObj = new AlchemyAPI.AlchemyAPI();
13+
14+
15+
// Load an API key from disk.
16+
alchemyObj.LoadAPIKey("api_key.txt");
17+
18+
// Load a HTML document to analyze.
19+
StreamReader streamReader = new StreamReader("data/example.html");
20+
string htmlDoc = streamReader.ReadToEnd();
21+
streamReader.Close();
22+
23+
// Extract concept tags for a web URL.
24+
string xml = alchemyObj.URLGetAuthor("http://www.politico.com/blogs/media/2012/02/detroit-news-ed-upset-over-romney-edit-115247.html");
25+
Console.WriteLine (xml);
26+
27+
// Extract concept tags for a web URL.
28+
xml = alchemyObj.HTMLGetAuthor(htmlDoc, "http://www.test.com/");
29+
Console.WriteLine (xml);
30+
}
31+
32+
}
33+

example/author/AssemblyInfo.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
4+
// Information about this assembly is defined by the following attributes.
5+
// Change them to the values specific to your project.
6+
7+
[assembly: AssemblyTitle("author")]
8+
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyConfiguration("")]
10+
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyProduct("")]
12+
[assembly: AssemblyCopyright("mike")]
13+
[assembly: AssemblyTrademark("")]
14+
[assembly: AssemblyCulture("")]
15+
16+
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17+
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
18+
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
19+
20+
[assembly: AssemblyVersion("1.0.*")]
21+
22+
// The following attributes are used to specify the signing key for the assembly,
23+
// if desired. See the Mono documentation for more information about signing.
24+
25+
//[assembly: AssemblyDelaySign(false)]
26+
//[assembly: AssemblyKeyFile("")]
27+

0 commit comments

Comments
 (0)