This repository was archived by the owner on Oct 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathAlchemyAPI_LanguageParams.cs
More file actions
75 lines (64 loc) · 1.51 KB
/
AlchemyAPI_LanguageParams.cs
File metadata and controls
75 lines (64 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using System;
using System.Web;
namespace AlchemyAPI
{
public class AlchemyAPI_LanguageParams : AlchemyAPI_BaseParams
{
public enum SourceTextMode
{
NONE,
CLEANED_OR_RAW,
CLEANED,
RAW,
CQUERY,
XPATH
}
private SourceTextMode sourceText;
private string cQuery;
private string xPath;
public SourceTextMode getSourceText()
{
return sourceText;
}
public void setSourceText(SourceTextMode sourceText)
{
this.sourceText = sourceText;
}
public string getCQuery()
{
return cQuery;
}
public void setCQuery(string cQuery)
{
this.cQuery = cQuery;
}
public string getXPath()
{
return xPath;
}
public void setXPath(string xPath)
{
this.xPath = xPath;
}
override public String getParameterString()
{
String retString = base.getParameterString();
if (sourceText != SourceTextMode.NONE)
{
if (sourceText == SourceTextMode.CLEANED_OR_RAW)
retString += "&sourceText=cleaned_or_raw";
else if (sourceText == SourceTextMode.CLEANED)
retString += "&sourceText=cleaned";
else if (sourceText == SourceTextMode.RAW)
retString += "&sourceText=raw";
else if (sourceText == SourceTextMode.CQUERY)
retString += "&sourceText=cquery";
else if (sourceText == SourceTextMode.CQUERY)
retString += "&sourceText=xpath";
}
if (cQuery != null) retString += "&cquery=" + HttpUtility.UrlEncode(cQuery);
if (xPath != null) retString += "&xpath=" + HttpUtility.UrlEncode(xPath);
return retString;
}
}
}