LanguageDetector icon indicating copy to clipboard operation
LanguageDetector copied to clipboard

It break's with some special characteres

Open hugomosh opened this issue 10 years ago • 1 comments

Excellent work! Thank you. Just an observations If you feed it with things like: x :) es genial¡¡¡¡¡¡

It throws and error like this:

exception 'RuntimeException' with message 'Invalid or missing outlinks' in C:\Users\personal\GoogleDrive\202_Librerias\LanguageDetector-master\lib\LanguageDetector\Sort\PageRank.php:152
Stack trace:
#0 C:\Users\personal\GoogleDrive\202_Librerias\LanguageDetector-master\lib\LanguageDetector\Detect.php(83): LanguageDetector\Sort\PageRank->sort(Array)
#1 C:\Users\personal\GoogleDrive\202_Librerias\LanguageDetector-master\lib\LanguageDetector\Detect.php(122): LanguageDetector\Detect->detectChunk('!')
#2 C:\Users\personal\GoogleDrive\202_Librerias\LanguageDetector-master\example\detectaIdiomaALista.php(24): LanguageDetector\Detect->detect('!')

Just saying, so it can be more robust :+1:

Maybe it could give "ascii art" as language : P

hugomosh avatar May 05 '14 18:05 hugomosh

Good idea. If it fails to parse UTF-8 it should treat the input as an stream of bytes.

crodas avatar May 06 '14 01:05 crodas