1 | <?php |
||
49 | class DictionaryRegistry implements \Iterator, \Countable |
||
50 | { |
||
51 | /** |
||
52 | * Storage for the Dictionaries. |
||
53 | * |
||
54 | * @var Dictionary[] $registry |
||
55 | */ |
||
56 | protected $registry = array(); |
||
57 | |||
58 | /** |
||
59 | * Add an item to the registry. |
||
60 | * |
||
61 | * @param Dictionary $dict The Dictionary to add to the registry |
||
62 | * |
||
63 | * @return DictionaryRegistry |
||
64 | */ |
||
65 | public function add(Dictionary $dict) |
||
73 | |||
74 | /** |
||
75 | * Get a dictionary entry by its key |
||
76 | * |
||
77 | * @param mixed $key The key to retrieve the Dictionary for |
||
78 | * |
||
79 | * @return Dictionary|null |
||
80 | */ |
||
81 | public function getDictionaryWithKey($key) |
||
89 | |||
90 | /** |
||
91 | * Get an array of hyphenation-patterns for a given word. |
||
92 | * |
||
93 | * @deprecated use getHyphenationPatterns() instead |
||
94 | * |
||
95 | * @param string $word The word to get the patterns for. |
||
96 | * |
||
97 | * @return array |
||
98 | */ |
||
99 | public function getHyphenationPattterns($word) |
||
103 | |||
104 | /** |
||
105 | * Get an array of hyphenation-patterns for a given word. |
||
106 | * |
||
107 | * @param string $word The word to get the patterns for. |
||
108 | * |
||
109 | * @return array |
||
110 | */ |
||
111 | public function getHyphenationPatterns($word) |
||
120 | |||
121 | /** |
||
122 | * Implementation of \Iterator |
||
123 | * |
||
124 | * @see \Iterator::rewind() |
||
125 | * |
||
126 | * @return void |
||
127 | */ |
||
128 | public function rewind() |
||
132 | |||
133 | /** |
||
134 | * Get the current object |
||
135 | * |
||
136 | * @see \Iterator::current() |
||
137 | * |
||
138 | * @return \Org\Heigl\Hyphenator\Dictionary\Dictionary |
||
139 | */ |
||
140 | public function current() |
||
144 | |||
145 | /** |
||
146 | * Get the current key |
||
147 | * |
||
148 | * @see \Iterator::key() |
||
149 | * |
||
150 | * @return mixed |
||
151 | */ |
||
152 | public function key() |
||
156 | |||
157 | /** |
||
158 | * Get the number of items in the registry |
||
159 | * |
||
160 | * @see \Countable::count() |
||
161 | * |
||
162 | * @return int |
||
163 | */ |
||
164 | public function count() |
||
168 | |||
169 | /** |
||
170 | * Push the internal pointer forward one step |
||
171 | * |
||
172 | * @see \Iterator::next() |
||
173 | * |
||
174 | * @return void |
||
175 | */ |
||
176 | public function next() |
||
180 | |||
181 | /** |
||
182 | * Check whether the current pointer is in a valid place |
||
183 | * |
||
184 | * @see \Iterator::valid() |
||
185 | * |
||
186 | * @return boolean |
||
187 | */ |
||
188 | public function valid() |
||
196 | } |
||
197 |