1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package com.octo.captcha.component.word;
20
21 import java.util.Locale;
22
23 public class ArrayDictionary implements DictionaryReader {
24
25 private DefaultSizeSortedWordList words;
26
27 public ArrayDictionary(String[] words) {
28 this.words = new DefaultSizeSortedWordList(Locale.US);
29 for (int i = 0; i < words.length; i++) {
30
31 String word = words[i];
32 this.words.addWord(word);
33 }
34 }
35
36
37 public SizeSortedWordList getWordList() {
38 return words;
39 }
40
41 public SizeSortedWordList getWordList(Locale locale) {
42 return words;
43 }
44 }