cvs: pear /Text_LanguageDetect/Text LanguageDetect.php
| From: | Nicholas Pisarro | Date: | Thu, 19 Jan 2006 04:07:50 +0000 |
| Subject: | cvs: pear /Text_LanguageDetect/Text LanguageDetect.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-37646@lists.php.net to get a copy of this message | ||
taak Thu Jan 19 04:07:50 2006 UTC
Modified files:
/pear/Text_LanguageDetect/Text LanguageDetect.php
Log:
added accessor function for $this->_use_unicode_narrowing private var
http://cvs.php.net/viewcvs.cgi/pear/Text_LanguageDetect/Text/LanguageDetect.php?r1=1.16&r2=1.17&diff_format=u
Index: pear/Text_LanguageDetect/Text/LanguageDetect.php
diff -u pear/Text_LanguageDetect/Text/LanguageDetect.php:1.16
pear/Text_LanguageDetect/Text/LanguageDetect.php:1.17
--- pear/Text_LanguageDetect/Text/LanguageDetect.php:1.16 Tue Jan 17 18:57:35 2006
+++ pear/Text_LanguageDetect/Text/LanguageDetect.php Thu Jan 19 04:07:50 2006
@@ -16,7 +16,7 @@
* @author Nicholas Pisarro <infinityminusnine+pear@gmail.com>
* @copyright 2005-2006 Nicholas Pisarro
* @license http://www.debian.org/misc/bsd.license BSD
- * @version CVS: $Id: LanguageDetect.php,v 1.16 2006/01/17 18:57:35 taak Exp $
+ * @version CVS: $Id: LanguageDetect.php,v 1.17 2006/01/19 04:07:50 taak Exp $
* @link http://pear.php.net/package/Text_LanguageDetect/
* @link http://langdetect.blogspot.com/
*/
@@ -158,8 +158,6 @@
/**
* Whether to use the unicode block detection to speed up processing
*
- * This is a stub flag; there is no accessor function to turn it on or off
- *
* @access private
* @var bool
*/
@@ -451,6 +449,24 @@
}
/**
+ * Whether to use unicode block ranges in detection
+ *
+ * Should speed up most detections if turned on (detault is on). In some
+ * circumstances it may be slower, such as for large text samples (> 10K)
+ * in languages that use latin scripts. In other cases it should speed up
+ * detection noticeably.
+ *
+ * @access public
+ * @param bool $setting false to turn off
+ */
+ function useUnicodeBlocks($setting = true)
+ {
+ if (is_bool($setting)) {
+ $this->_use_unicode_narrowing = $setting;
+ }
+ }
+
+ /**
* Converts a piece of text into trigrams
*
* Superceded by the Text_LanguageDetect_Parser class