@param string $keyword

@return string|false
349534
protected function _guessController($keyword)
    {
        $controllers = [];

        foreach ($this->filesystem->glob('@manaphp/Cli/Controllers/*Controller.php') as $file) {
            if (preg_match('#/(\w+)Controller\.php$#', $file, $matches)) {
                $controllers[$matches[1]] = "ManaPHP\\Cli\Controllers\\{$matches[1]}Controller";
            }
        }

        if ($this->alias->has('@cli')) {
            foreach ($this->filesystem->glob('@cli/*Controller.php') as $file) {
                if (preg_match('#/(\w+)Controller\.php$#', $file, $matches)) {
                    $controllers[$matches[1]] = $this->alias->resolveNS("@ns.cli\\{$matches[1]}Controller");
                }
            }
        }

        $guessed = [];
        foreach ($controllers as $name => $className) {
            if (stripos($name, $keyword) === 0) {
                $guessed[] = $className;
            }
        }

        if (!$guessed) {
            foreach ($controllers as $name => $className) {
                if (stripos($name, $keyword) !== false) {
                    $guessed[] = $className;
                }
            }
        }

        return count($guessed) === 1 ? $guessed[0] : false;
    }
369384
public function grep( $word ) {
		$found = array();
		foreach($this->logs as $log) {
			if (strpos($log,$word)!==false) {
				$found[] = $log;
			}
		}
		return $found;
	}
930551
public function parseKeyword($keyword)
	{
		list($keyword, $alias) = explode(' as ', $keyword);
		if (false !== strpos($keyword, '(') && false !== strpos($keyword, ')'))
		{
			// 字段带函数
			$result = $keyword;
		}
		else
		{
			$names = explode('.', $keyword);
			$last = array_pop($names);
			if(isset($names[0]))
			{
				$result = $this->paramFlag[0] . implode($this->paramFlag[1] . '.' . $this->paramFlag[0],$names) . $this->paramFlag[1];
				$prefix = '.';
			}
			else
			{
				$prefix = '';
			}
			if('*' === $last)
			{
				$result .= $prefix . $last;
			}
			else
			{
				$result .= $prefix . $this->paramFlag[0] . $last . $this->paramFlag[1];
			}
		}
		if(null !== $alias)
		{
			$result .= ' as ' . $this->paramFlag[0] . $alias . $this->paramFlag[1];
		}
		return $result;
	}
907874
protected function _prepareMetaKeyword($keywords, $removeDuplicatedWords = true)
    {

        $string = $this->_prepareMetaDescription($keywords, -1, false);

        if ($removeDuplicatedWords) {
            $string = $this->_removeDuplicatedWords($string, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aSkipTags'));
        }

        return trim($string);
    }
1151656
public function isKeyword($word)
    {
        if ($this->keywords === null) {
            $this->initializeKeywords();
        }

        return isset($this->keywords[strtoupper($word)]);
    }
1216273
protected function countTotalListViewData($keyword = null) {
        $count = 0;

        if ($this->listViewDataClosure != null) {

            if ($this->countListViewDataClosure != null) {
                $c = $this->countListViewDataClosure;
                return  $c($keyword);
            } else {
                return 100000;
            }

        } elseif ($this->searchResultCountClosure != null) {            // For Custom Searching
            $c = $this->searchResultCountClosure;
            return $c($keyword);
            
        } else {
            $this->beforeGetListViewData(function ($tableName, $findClause, $limit, $bindingData) use (&$count) {

                // For RedBean Case
                $count = R::getCell("SELECT COUNT(*) FROM `$tableName` WHERE $findClause $limit", $bindingData);

            }, function ($sql, $limit, $bindingData) use (&$count) {

                // For SQL Case
                $count = R::getRow("SELECT COUNT(*) AS `count` FROM (" . $sql . $limit . ") AS user_defined_query", $bindingData)["count"];

            }, null, null, $keyword);

        }



        return $count;
    }
530552
def match_keyword(token, keywords):
    
    if not token:
        return False
    if not token.is_keyword:
        return False

    return token.value.upper() in keywords
909670
public function keyword($keyword)
    {
        $this->andWhere([
            'or',
            ['and', '{{type}}=:typeMatch', '{{keyword}}=:keyword'], // 直接匹配关键字
            ['and', '{{type}}=:typeInclude', 'INSTR(:keyword, {{keyword}})>0'], // 包含关键字
            ['and', '{{type}}=:typeRegular', ':keyword REGEXP {{keyword}}'], // 正则匹配关键字
        ])
        ->addParams([
            ':keyword' => $keyword,
            ':typeMatch' => ReplyRuleKeyword::TYPE_MATCH,
            ':typeInclude' => ReplyRuleKeyword::TYPE_INCLUDE,
            ':typeRegular' => ReplyRuleKeyword::TYPE_REGULAR
        ]);
        return $this;
    }
168017
public function setHeadword($headword, $addSynonyms = false)
    {
        if (is_string($headword)) {
            return Headword::add($headword, $this, $addSynonyms);
        }
        if ($headword instanceof Headword) {
            return Headword::add($headword->word, $this, $addSynonyms);
        }
    }
132545
public static function match($keyword, $text = '', &$matches = false) {
        return (bool)preg_match(sprintf(self::$re, self::regex($keyword)), $text, $matches, PREG_OFFSET_CAPTURE);
    }
1354720
protected function getKeywordAsArray($keywords) {
        if (null === $keywords) {
            return array();
        }

        if (is_string($keywords)) {
            return explode(',', $keywords);
        } else {
            $keywords = $keywords->toArray();
            foreach ($keywords as &$keyword) {
                $keyword = $keyword->getId();
            }

            return $keywords;
        }
    }
78491
public function serialize(Keyword $keyword, array $options = [])
    {
        $serialized = [
            'id' => $keyword->getUuid(),
            'name' => $keyword->getName(),
        ];

        return $serialized;
    }
894032
protected function smartGlobalSearch($keyword)
    {
        collect(explode(' ', $keyword))
            ->reject(function ($keyword) {
                return trim($keyword) === '';
            })
            ->each(function ($keyword) {
                $this->globalSearch($keyword);
            });
    }
1161970
private function findSynonym(KeywordInterface $keyword)
    {
        return $this->keywordRepository->findByKeyword($keyword->getKeyword(), $keyword->getLocale());
    }
73676
public function transform($keywords)
    {
        if (null === $keywords) {
            return '';
        }

        $keywordCondition = $this->getKeywordAsCondition($keywords);
        $keywordArray = $this->getKeywordAsArray($keywords);

        foreach ($keywordArray as $keyword) {
            if ($keyword != '') {
                $keywordDocument = $this->keywordRepository->find($keyword);
                if (!is_null($keywordDocument)) {
                    $keywords = str_replace($keyword, $keywordDocument->getLabel(), $keywordCondition);
                } else {
                    throw new NotFoundedKeywordException();
                }
            }
        }

        return $keywordCondition;
    }
630626
protected function globalSearch($keyword)
    {
        $this->query->where(function ($query) use ($keyword) {
            collect($this->request->searchableColumnIndex())
                ->map(function ($index) {
                    return $this->getColumnName($index);
                })
                ->reject(function ($column) {
                    return $this->isBlacklisted($column) && ! $this->hasFilterColumn($column);
                })
                ->each(function ($column) use ($keyword, $query) {
                    if ($this->hasFilterColumn($column)) {
                        $this->applyFilterColumn($query, $column, $keyword, 'or');
                    } else {
                        $this->compileQuerySearch($query, $column, $keyword);
                    }

                    $this->isFilterApplied = true;
                });
        });
    }
365787
static public function fetchTagsByKeyword( $keyword, $language = false )
    {
        if ( $language )
        {
            if ( !is_array( $language ) )
                $language = array( $language );
            eZContentLanguage::setPrioritizedLanguages( $language );
        }

        if ( strpos( $keyword, '*' ) !== false )
        {
            $keyword = preg_replace(
                array(
                    '#%#m',
                    '#(?<!\\\\)\\*#m',
                    '#(?<!\\\\)\\\\\\*#m',
                    '#\\\\\\\\#m'
                ),
                array(
                    '\\%',
                    '%',
                    '*',
                    '\\\\'
                ),
                $keyword
            );

            $keyword = array( 'like', $keyword );
        }

        $result = eZTagsObject::fetchByKeyword( $keyword );

        if ( $language )
            eZContentLanguage::clearPrioritizedLanguages();

        if ( is_array( $result ) && !empty( $result ) )
            return array( 'result' => $result );

        return array( 'result' => false );
    }