Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace CirrusSearch\LanguageDetector; |
4 | |
5 | use CirrusSearch\SearchConfig; |
6 | |
7 | /** |
8 | * Interface for a language detector class |
9 | */ |
10 | interface Detector { |
11 | |
12 | /** |
13 | * @param SearchConfig $config |
14 | * @return Detector |
15 | */ |
16 | public static function build( SearchConfig $config ); |
17 | |
18 | /** |
19 | * Detect language |
20 | * |
21 | * @param string $text Text to detect language |
22 | * @return string|null Preferred language, or null if none found |
23 | */ |
24 | public function detect( $text ); |
25 | } |