-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathContext.cs
60 lines (52 loc) · 1.87 KB
/
Context.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
namespace HunspellSharp
{
class Context : StringHelper
{
public string sfxappnd; // BUG: not stateless // previous suffix for counting syllables of the suffix
public int sfxextra; // BUG: not stateless // modifier for syllable count of sfxappnd
public ushort sfxflag; // BUG: not stateless
public SfxEntry sfx; // BUG: not stateless
public PfxEntry pfx; // BUG: not stateless
public readonly Timer compoundCheckTimer = new Timer();
public readonly CountdownTimer suggestInnerTimer = new CountdownTimer();
public byte[] lcsB, lcsC;
public metachar_data[] btinfo;
hentry[] rwords; // buffer for COMPOUND pattern checking
public hentry[] GetCompoundCheckBuffer()
{
if (rwords == null) rwords = new hentry[100];
return rwords;
}
hentry[] roots;
string[] rootsphon;
Guess[] guess;
int[] scores, scoresphon, gscore;
guessword[] guessword;
public void GetRootsBuffers(out hentry[] roots, out string[] rootsphon, out int[] scores, out int[] scoresphon)
{
if (this.roots == null)
{
this.roots = new hentry[Hunspell.MAX_ROOTS];
this.rootsphon = new string[Hunspell.MAX_ROOTS];
this.scores = new int[Hunspell.MAX_ROOTS];
this.scoresphon = new int[Hunspell.MAX_ROOTS];
}
roots = this.roots;
rootsphon = this.rootsphon;
scores = this.scores;
scoresphon = this.scoresphon;
}
public void GetGuessBuffers(out Guess[] guess, out int[] gscore, out guessword[] guessword)
{
if (this.guess == null)
{
this.guess = new Guess[Hunspell.MAX_GUESS];
this.gscore = new int[Hunspell.MAX_GUESS];
this.guessword = new guessword[Hunspell.MAX_WORDS];
}
guess = this.guess;
gscore = this.gscore;
guessword = this.guessword;
}
}
}