VicWordService.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace crmeb\services;
  12. use Lizhichao\Word\VicWord;
  13. class VicWordService
  14. {
  15. public function getWord($str)
  16. {
  17. $data = [$str];
  18. if (systemConfig('vic_word_status')) {
  19. ini_set('memory_limit', '-1');
  20. $vicWord = new VicWord();
  21. $word = $vicWord->getAutoWord($str);
  22. foreach ($word as $item) {
  23. if ($item[2] === '0' || is_numeric($item[0])) {
  24. continue;
  25. }
  26. $data[] = $item[0];
  27. }
  28. }
  29. return $data;
  30. }
  31. }