检测是否有凹点，如果有返回该凹点
481130
private function checkConcave($angles)
    {
        try {
            for ($i = 0; $i < count($angles); $i++) {
                if (180 < $angles[$i]->getAngle()) {
                    return $i;
                }

            }

            return false;
        } catch (\Exception $e) {
            throw $e;
        }
    }
1074728
function () {
        var fileList = [];
        /*获取原文件列表*/
        Object.keys(src).forEach(function(key){
            fileList.push(src[key]);
        });
        return fileList;
    }
1080984
function (jsonObj) {
    if ($bc_.pN) {
      try {
        var params = jsonObj || {}
        params['silent'] = params['silent'] || false
        params['printBackground'] = params['printBackground'] || false

        // 统一向后兼容处理
        for (var key in jsonObj) {
          if (jsonObj.hasOwnProperty(key)) {
            params[key] = jsonObj[key]
          }
        }

        return $bc_.pN.window.print(JSON.stringify(params))
      } catch (e) {
        console.error(e)
      }
    }
  }
801199
public static void notNull(Object object, String message) {
        if (object == null)
            throw new IllegalArgumentException(message);
        /*
        * 如果是字符串，我不希望你的字符串是一个空字符串，那样没有任何意义，
        * 但是你仍然坚持要为空，那你可以添加一个空格(" ")试试
        * */
        if (object instanceof String)
            if (StringUtils.isEmpty((String) object))
                throw new IllegalArgumentException(message);
    }
381869
public static boolean isAllNum(String str)
    {
        if (str == null)
            return false;

        int i = 0;
        /** 判断开头是否是+-之类的符号 */
        if ("±+-＋－—".indexOf(str.charAt(0)) != -1)
            i++;
        /** 如果是全角的０１２３４５６７８９ 字符* */
        while (i < str.length() && "０１２３４５６７８９".indexOf(str.charAt(i)) != -1)
            i++;
        // Get middle delimiter such as .
        if (i > 0 && i < str.length())
        {
            char ch = str.charAt(i);
            if ("·∶:，,．.／/".indexOf(ch) != -1)
            {// 98．1％
                i++;
                while (i < str.length() && "０１２３４５６７８９".indexOf(str.charAt(i)) != -1)
                    i++;
            }
        }
        if (i >= str.length())
            return true;

        /** 如果是半角的0123456789字符* */
        while (i < str.length() && "0123456789".indexOf(str.charAt(i)) != -1)
            i++;
        // Get middle delimiter such as .
        if (i > 0 && i < str.length())
        {
            char ch = str.charAt(i);
            if (',' == ch || '.' == ch || '/' == ch  || ':' == ch || "∶·，．／".indexOf(ch) != -1)
            {// 98．1％
                i++;
                while (i < str.length() && "0123456789".indexOf(str.charAt(i)) != -1)
                    i++;
            }
        }

        if (i < str.length())
        {
            if ("百千万亿佰仟%％‰".indexOf(str.charAt(i)) != -1)
                i++;
        }
        if (i >= str.length())
            return true;

        return false;
    }
25999
private static void process(){
        //分析语料库
        analyzeCorpus();
        //分析处理并保存短语结构
        processPhrase();
        //分析处理并保存二元模型
        processBiGram();
        BIGRAM.clear();
        //分析处理并保存三元模型
        processTriGram();
        TRIGRAM.clear();
        //分析处理并保存语料库中提取出来的词
        processWords();
        WORDS.clear();
        //将新提取的词和原来的词典合并
        mergeWordsWithOldDic();
        //移除词典中的短语结构
        DictionaryTools.removePhraseFromDic("target/phrase.txt", "src/main/resources/dic.txt");
    }
209341
function () {
            var reg = new RegExp(domUtils.fillChar, 'g');
            //取出来的空格会有c2a0会变成乱码，处理这种情况\u00a0
            return this.body[browser.ie ? 'innerText' : 'textContent'].replace(reg, '').replace(/\u00a0/g, ' ');
        }
33103
public static void parsePattern(List<NR> nrList, List<Vertex> vertexList, final WordNet wordNetOptimum, final WordNet wordNetAll)
    {
        // 拆分UV
        ListIterator<Vertex> listIterator = vertexList.listIterator();
        StringBuilder sbPattern = new StringBuilder(nrList.size());
        NR preNR = NR.A;
        boolean backUp = false;
        int index = 0;
        for (NR nr : nrList)
        {
            ++index;
            Vertex current = listIterator.next();
//            logger.trace("{}/{}", current.realWord, nr);
            switch (nr)
            {
                case U:
                    if (!backUp)
                    {
                        vertexList = new ArrayList<Vertex>(vertexList);
                        listIterator = vertexList.listIterator(index);
                        backUp = true;
                    }
                    sbPattern.append(NR.K.toString());
                    sbPattern.append(NR.B.toString());
                    preNR = B;
                    listIterator.previous();
                    String nowK = current.realWord.substring(0, current.realWord.length() - 1);
                    String nowB = current.realWord.substring(current.realWord.length() - 1);
                    listIterator.set(new Vertex(nowK));
                    listIterator.next();
                    listIterator.add(new Vertex(nowB));
                    continue;
                case V:
                    if (!backUp)
                    {
                        vertexList = new ArrayList<Vertex>(vertexList);
                        listIterator = vertexList.listIterator(index);
                        backUp = true;
                    }
                    if (preNR == B)
                    {
                        sbPattern.append(NR.E.toString());  //BE
                    }
                    else
                    {
                        sbPattern.append(NR.D.toString());  //CD
                    }
                    sbPattern.append(NR.L.toString());
                    // 对串也做一些修改
                    listIterator.previous();
                    String EorD = current.realWord.substring(0, 1);
                    String L = current.realWord.substring(1, current.realWord.length());
                    listIterator.set(new Vertex(EorD));
                    listIterator.next();
                    listIterator.add(new Vertex(L));
                    continue;
                default:
                    sbPattern.append(nr.toString());
                    break;
            }
            preNR = nr;
        }
        String pattern = sbPattern.toString();
//        logger.trace("模式串：{}", pattern);
//        logger.trace("对应串：{}", vertexList);
//        if (pattern.length() != vertexList.size())
//        {
//            logger.warn("人名识别模式串有bug", pattern, vertexList);
//            return;
//        }
        final Vertex[] wordArray = vertexList.toArray(new Vertex[0]);
        final int[] offsetArray = new int[wordArray.length];
        offsetArray[0] = 0;
        for (int i = 1; i < wordArray.length; ++i)
        {
            offsetArray[i] = offsetArray[i - 1] + wordArray[i - 1].realWord.length();
        }
        trie.parseText(pattern, new AhoCorasickDoubleArrayTrie.IHit<NRPattern>()
        {
            @Override
            public void hit(int begin, int end, NRPattern value)
            {
//            logger.trace("匹配到：{}", keyword);
                StringBuilder sbName = new StringBuilder();
                for (int i = begin; i < end; ++i)
                {
                    sbName.append(wordArray[i].realWord);
                }
                String name = sbName.toString();
//            logger.trace("识别出：{}", name);
                // 对一些bad case做出调整
                switch (value)
                {
                    case BCD:
                        if (name.charAt(0) == name.charAt(2)) return; // 姓和最后一个名不可能相等的
//                        String cd = name.substring(1);
//                        if (CoreDictionary.contains(cd))
//                        {
//                            EnumItem<NR> item = PersonDictionary.dictionary.get(cd);
//                            if (item == null || !item.containsLabel(Z)) return; // 三字名字但是后两个字不在词典中，有很大可能性是误命中
//                        }
                        break;
                }
                if (isBadCase(name)) return;

                // 正式算它是一个名字
                if (HanLP.Config.DEBUG)
                {
                    System.out.printf("识别出人名：%s %s\n", name, value);
                }
                int offset = offsetArray[begin];
                wordNetOptimum.insert(offset, new Vertex(Predefine.TAG_PEOPLE, name, ATTRIBUTE, WORD_ID), wordNetAll);
            }
        });
    }
1027888
function isOTag (str, oTag, index) {
    var l = oTag.length, s = str.substr(index, l), sign = str.charAt(index+l);
    // NOTE 要保证sign有值 如果当前的index已经是字符串尾部 如'foo{{' sign为空
    if (oTag === s && sign && SIGN.indexOf(sign) > -1) {
        return {
            str: s + sign,
            index: index,
            // sign: signType[str.charAt(index+l)], // TODO: delete
            sign: str.charAt(index+l),
            // ignore the last oTag charts and the sign char,
            // l(oTag.length) - 1(oTag's first char) + 1(sign's char)
            jump: l
        };
    }
}
897797
function filter(results, data, ignored) {
    if (!data.length) return results;
    //这里是为了缓存match匹配函数
    var preMatchesCache = matchesCache;
    matchesCache = createMatches(data);
    for (var i = results.length; i--;) {
      if (!matchData(results[i], data, ignored)) {
        results.splice(i, 1);
      }
    }
    // Fixed: 因为一次filter可能会有字filter调用，比如matches、not、include
    matchesCache = preMatchesCache; // warning :以后写全局变量一定当心
    return results;
  }
798765
function getlist(fpath, prefix) {
    try {
      folders = fs.readdirSync(fpath);
    } catch (e) {
      return;
    }

    prefix = prefix || '';

    _.each(folders, function(f) {
      var p;
      npath = path.join(fpath, f);

      // 如果当前f是文件夹，则添加代表文件夹的分隔符，否则判断文件名是否匹配正则，不匹配则不扔进数组
      if (fs.existsSync(npath) && fs.lstatSync(npath).isDirectory()) {

        f += '/';

        // 如果要获取所有文件则递归获取下一层目录的文件
        if (hasGrep) getlist(npath, prefix + f);

      } else if (f.match(re)) {

        p = re ? RegExp.$1 : f;

      } else {
        return;
      }

      // 如果grepKey为string则匹配文件/文件夹名
      if (hasGrep && f.indexOf(grepKey) === -1) return;

      urlList.push({
        name: f,
        path: prefix + (p || f)
      });
    });
  }
455688
function getall()
    {
        //启用了Cache
        if ($this->enableCache)
        {
            $this->getsql(false);
            //指定Cache的Key
            if (empty($this->cacheOptions['key']))
            {
                $cache_key = self::CACHE_PREFIX . '_all_' . md5($this->sql);
            }
            else
            {
                $cache_key = $this->cacheOptions['key'];
            }
            //指定使用哪个Cache实例
            if (empty($this->cacheOptions['object_id']))
            {
                $cacheObject = \Swoole::$php->cache;
            }
            else
            {
                $cacheObject = \Swoole::$php->cache($this->cacheOptions['object_id']);
            }
            //指定缓存的生命周期
            if (empty($this->cacheOptions['lifetime']))
            {
                $cacheLifeTime = self::CACHE_LIFETIME;
            }
            else
            {
                $cacheLifeTime = intval($this->cacheOptions['lifetime']);
            }

            $data = $cacheObject->get($cache_key);
            //Cache数据为空，从DB中拉取
            if (empty($data))
            {
                $data = $this->_execute();
                $cacheObject->set($cache_key, $data, $cacheLifeTime);
                return $data;
            }
            else
            {
                return $data;
            }
        }
        else
        {
            return $this->_execute();
        }
    }
224585
def getList(self):
        

        desc = {
            "name": "ListWordfilterReslut",
            "desc": "listWordfilter返回结果",
            "fields": [{
                "name": "code",
                "type": "Integer",
                "desc": "返回码，200 为正常。"
            }, {
                "name": "word",
                "type": "String",
                "desc": "敏感词内容。"
            }, {
                "name": "errorMessage",
                "type": "String",
                "desc": "错误信息。"
            }]
        }
        r = self.call_api(
            method=('API', 'POST', 'application/x-www-form-urlencoded'),
            action='/wordfilter/list.json',
            params={})
        return Response(r, desc)
980174
function (withWhitespace) {
                var tok;

                // 如果已经有缓存的预读
                if (this.peeked) {
                    if (!withWhitespace && this.peeked.type == lexer.TOKEN_WHITESPACE) {
                        this.peeked = null;
                    } else {
                        tok = this.peeked;
                        this.peeked = null;
                        return tok;
                    }
                }

                tok = this.tokens.nextToken();

                // ... 默认如果下一个tokens是空白字符 则返回下下个token
                // ... 当withWhitespace为true时 即nextToken(true) 则不考虑是否是空白字符
                if (!withWhitespace) {
                    while (tok && tok.type == lexer.TOKEN_WHITESPACE) {
                        tok = this.tokens.nextToken();
                    }
                }

                return tok;
            }
180897
function getPostList(issues) {
  if (!issues.body || !issues.headers) return;

  let pageInfo = getPage(issues.headers.link);
  let pageList = [];

  issues.body.forEach((item) => {
    // 如果文章不存在分类，则不展示出来，该功能先取消
    // if (!item.labels || item.labels.length === 0) return;

    pageList.push(getPost(item));
  });

  return {
    page: pageInfo,
    list: pageList
  }
}
566808
function parseChildren() {

		let ary = [], node;

		// 循环直到遇见标签闭合Token
		while ( !reader.eof() && reader.getCurrentToken().type != options.TypeTagClose ) {
			node = parseTag();
			node && ary.push(node);

			node = parseComment();
			node && ary.push(node);

			node = parseCodeBlock();
			node && ary.push(node);

			node = parseText();
			node && ary.push(node);

			node = parseExpression();
			node && ary.push(node);
		}

		return ary;
	}
1351020
public function rules()
    {
        return [
            ['username', 'required', '帐号不能为空', Validate::MUST_VALIDATE],
            ['password', 'required', '密码不能为空', Validate::EXISTS_VALIDATE],
            ['code', 'captcha', '验证码输入错误', Validate::EXISTS_VALIDATE],
        ];
    }