-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMPAlignerConfigurationStopWordListEntry.cs
87 lines (77 loc) · 2.16 KB
/
MPAlignerConfigurationStopWordListEntry.cs
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
76
77
78
79
80
81
82
83
84
85
86
//
// MPAlignerConfigurationStopWordListEntry.cs
//
// Author:
// Mārcis Pinnis <marcis.pinnis@gmail.com>
//
// Copyright (c) 2013 Mārcis Pinnis
//
// This program can be freely used only for scientific and educational purposes.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
using System;
using System.Xml.Serialization;
using System.Text;
namespace MPAligner
{
public class MPAlignerConfigurationStopWordListEntry
{
public MPAlignerConfigurationStopWordListEntry ()
{
use = true;
lang = null;
path = null;
encodingCodePage = 65001;
stem = false;
}
[XmlAttribute("use")]
public bool use;
/// <summary>
/// Whether (true) or not (false) to use (lightweight!!!) stemming of the dictionary entries.
/// </summary>
[XmlAttribute("stem")]
public bool stem;
/// <summary>
/// The language.
/// </summary>
[XmlAttribute("lang")]
public string lang {
get {
return _lang;
}
set {
if (!string.IsNullOrWhiteSpace(value))
{
_lang = MPFramework.MPFrameworkFunctions.GetValidLangString(value);
}
}
}
[XmlIgnore]
private string _lang;
/// <summary>
/// The dictionary path.
/// </summary>
[XmlElement("path")]
public string path;
/// <summary>
/// Gets or sets the encoding.
/// </summary>
/// <value>
/// The encoding.
/// For UTF-8 use 65001.
/// </value>
[XmlAttribute("enc")]
public int encodingCodePage {
get {
return encoding.CodePage;
}
set {
encoding = Encoding.GetEncoding(value);
}
}
[XmlIgnore]
public Encoding encoding;
}
}