建立缺省的标签字典
@return 标签字典
510290
public LabelAlphabet DefaultLabelAlphabet()	{
		IAlphabet alphabet = null;
		if (!maps.containsKey(DefalutLabelName))	{
			maps.put(DefalutLabelName, new LabelAlphabet());
			alphabet = maps.get(DefalutLabelName);
		}else	{
			alphabet = maps.get(DefalutLabelName);
			if (!(alphabet instanceof LabelAlphabet))	{
				throw new ClassCastException();
			}
		}
		return (LabelAlphabet) alphabet;
	}
632921
@Override
	public ThriftConnection<T> pollConnection() {
		ThriftConnection<T> result;
		if (pool.getThriftServerCount() == 0) {
			throw new IllegalStateException("当前无可用连接服务器");
		}
		int partition = (int) (Thread.currentThread().getId() % this.pool.thriftServerCount);

		ThriftConnectionPartition<T> thriftConnectionPartition = this.pool.partitions.get(partition);

		result = thriftConnectionPartition.poolFreeConnection();
		if (result == null) {
			for (int i = 0; i < this.pool.thriftServerCount; i++) {
				if (i == partition) {
					continue;
				}
				result = this.pool.partitions.get(i).poolFreeConnection();
				if (result != null) {
					thriftConnectionPartition = this.pool.partitions.get(i);
					break;
				}
			}
		}

		if (!thriftConnectionPartition.isUnableToCreateMoreTransactions()) {
			this.pool.maybeSignalForMoreConnections(thriftConnectionPartition);
		}
		return result;
	}
438387
public String edit() {
    Role role = (Role) getEntity();
    User me = userService.get(SecurityUtils.getUsername());
    if (role.isPersisted()) {
      if (!roleService.isAdmin(me, role)) {
        if (null != role.getParent())
          return redirect("search", "不能修改该组,你没有" + role.getParent().getName() + "的管理权限");
        else return redirect("search", "不能修改该组,你没有Root的管理权限");
      }
    }
    put("role", role);
    OqlBuilder<Role> query = OqlBuilder.from(getEntityName(), "role");
    if (!isAdmin()) {
      query.join("role.members", "gm");
      query.where("gm.user=:me and gm.manager=true", me);
    }
    List<Role> parents = entityDao.search(query);
    parents.removeAll(HierarchyEntityUtils.getFamily(role));
    put("parents", parents);
    return forward();
  }
313453
public Object read() {
    HSSFSheet sheet = workbook.getSheetAt(sheetNum);
    if (indexInSheet > sheet.getLastRowNum()) { return null; }
    HSSFRow row = sheet.getRow(indexInSheet);
    indexInSheet++;
    // 如果是个空行,返回空记录
    if (row == null) {
      return new Object[attrCount];
    } else {
      Object[] values = new Object[((attrCount != 0) ? attrCount : row.getLastCellNum())];
      for (int k = 0; k < values.length; k++) {
        values[k] = getCellValue(row.getCell(k));
      }
      return values;
    }
  }
1130966
public final String getAbsolutePath() {
		if (FileUtil.isAbsolutePath(this.path)) {
			return this.path;
		}
		// url在初始化的时候已经断言，此处始终不为null
		return FileUtil.normalize(URLUtil.getDecodedPath(this.url));
	}
1282935
private List<From> findFrom(SQLTableSource from) {
        //zhongshu-comment class1.isAssignableFrom(class2) class2是不是class1的子类或者子接口
        //改成用instanceof 应该也行吧：from instanceof SQLExprTableSource
        boolean isSqlExprTable = from.getClass().isAssignableFrom(SQLExprTableSource.class);

        if (isSqlExprTable) {
            SQLExprTableSource fromExpr = (SQLExprTableSource) from;
            String[] split = fromExpr.getExpr().toString().split(",");

            ArrayList<From> fromList = new ArrayList<>();
            for (String source : split) {
                fromList.add(new From(source.trim(), fromExpr.getAlias()));
            }
            return fromList;
        }

        SQLJoinTableSource joinTableSource = ((SQLJoinTableSource) from);
        List<From> fromList = new ArrayList<>();
        fromList.addAll(findFrom(joinTableSource.getLeft()));
        fromList.addAll(findFrom(joinTableSource.getRight()));
        return fromList;
    }
899816
private static int getMachinePiece() {
		// 机器码
		int machinePiece;
		try {
			StringBuilder netSb = new StringBuilder();
			// 返回机器所有的网络接口
			Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
			// 遍历网络接口
			while (e.hasMoreElements()) {
				NetworkInterface ni = e.nextElement();
				// 网络接口信息
				netSb.append(ni.toString());
			}
			// 保留后两位
			machinePiece = netSb.toString().hashCode() << 16;
		} catch (Throwable e) {
			// 出问题随机生成,保留后两位
			machinePiece = (RandomUtil.randomInt()) << 16;
		}
		return machinePiece;
	}
1103386
public GetMenuResponse getMenu() {
        GetMenuResponse response;
        LOG.debug("获取菜单信息.....");
        String url = BASE_API_URL + "cgi-bin/menu/get?access_token=#";

        BaseResponse r = executeGet(url);
        if (isSuccess(r.getErrcode())) {
            JSONObject jsonObject = JSONUtil.getJSONFromString(r.getErrmsg());
            //通过jsonpath不断修改type的值，才能正常解析- -
            List buttonList = (List) JSONPath.eval(jsonObject, "$.menu.button");
            if (CollectionUtil.isNotEmpty(buttonList)) {
                for (Object button : buttonList) {
                    List subList = (List) JSONPath.eval(button, "$.sub_button");
                    if (CollectionUtil.isNotEmpty(subList)) {
                        for (Object sub : subList) {
                            Object type = JSONPath.eval(sub, "$.type");
                            JSONPath.set(sub, "$.type", type.toString().toUpperCase());
                        }
                    } else {
                        Object type = JSONPath.eval(button, "$.type");
                        JSONPath.set(button, "$.type", type.toString().toUpperCase());
                    }
                }
            }
            response = JSONUtil.toBean(jsonObject.toJSONString(), GetMenuResponse.class);
        } else {
            response = JSONUtil.toBean(r.toJsonString(), GetMenuResponse.class);
        }
        return response;
    }
152481
private static File getIDEDocumentRoot() {
        if (LOCAL_DOC_ROOT != null && LOCAL_DOC_ROOT.exists()) {
            log.debug("当前在IDE中运行，并且找到了工作空间");
            return LOCAL_DOC_ROOT;
        } else if (DEFAULT_DOC_ROOT != null && DEFAULT_DOC_ROOT.exists()) {
            log.debug("当前在IDE中运行，没有找到了工作空间，但是找到了classpath下的doc-root");
            return DEFAULT_DOC_ROOT;
        } else {
            log.debug("当前没有在IDE中运行");
            return null;
        }
    }
423822
public function getBasePath()
    {
        if (!$this->basePath) {
            $class = new \ReflectionClass($this);
            $this->basePath = substr(dirname($class->getFileName()), strlen(getcwd()) + 1);

            // TODO 改为默认
            if (substr($class->getName(), 0, 8) == 'Miaoxing') {
                $this->basePath = dirname($this->basePath);
            }
        }

        return $this->basePath;
    }
275034
public Iterable<MultiPart> parts() throws IOException {
        if (!isMultipart()) return emptyIterable;
        final String boundarystr = "--" + this.boundary;
        final Pattern fielnameReg = this.fielnamePattern;
        final String endboundary = boundarystr + "--";
        final byte[] boundarray = ("\n" + boundarystr).getBytes();
        final byte[] buffer = new byte[boundarray.length];
        final InputStream input = this.in;
        final DefaultAnyValue params = this.parameters;
        final AtomicBoolean finaled = new AtomicBoolean(false);
        return () -> new Iterator<MultiPart>() {

            private String boundaryline;

            private MultiPart lastentry;

            @Override
            public boolean hasNext() {
                try {
                    if (lastentry != null) {
                        lastentry.skip();
                        if (finaled.get()) return false;
                    }
                    if (boundaryline == null) boundaryline = readBoundary();
                    //if (debug) System.out.print("boundaryline=" + boundaryline + "  ");
                    if (endboundary.equals(boundaryline) || !boundarystr.equals(boundaryline)) { //结尾或异常
                        lastentry = null;
                        return false;
                    }
                    final String disposition = readLine();
                    //if (debug) System.out.println("disposition=" + disposition);
                    if (disposition.contains("; filename=\"")) { //是上传文件
                        String contentType = "";
                        //读掉HTTP Header和空白行 通常情况下Content-Type后面就是内容，但是有些特殊情况下后面会跟其他如Content-Length: xxx等HTTP header，所以需要循环读取
                        String rl;
                        while (!(rl = readLine()).isEmpty()) {
                            if (rl.startsWith("Content-Type:")) contentType = rl.substring(rl.indexOf(':') + 1).trim();
                        }
                        //if (debug) System.out.println("file.contentType=" + contentType);

                        String name = parseValue(disposition, "name");
                        String filename = parseValue(disposition, "filename");
                        if (filename == null || filename.isEmpty()) { //没有上传
                            readLine(); //读掉空白行
                            this.boundaryline = null;
                            this.lastentry = null;
                            return this.hasNext();
                        } else {
                            int p1 = filename.lastIndexOf('/');
                            if (p1 < 0) p1 = filename.lastIndexOf('\\');
                            if (p1 >= 0) filename = filename.substring(p1 + 1);
                        }
                        final AtomicLong counter = new AtomicLong(0);
                        InputStream source = new InputStream() {

                            private int bufposition = buffer.length;

                            private boolean end;

                            @Override
                            public int read() throws IOException {
                                if (end) return -1;
                                final byte[] buf = buffer;
                                int ch = (this.bufposition < buf.length) ? (buf[this.bufposition++] & 0xff) : input.read();
                                if ((ch == '\r' && readBuffer())) return -1;
                                counter.incrementAndGet();
                                return ch;
                            }

                            private boolean readBuffer() throws IOException {
                                final byte[] buf = buffer;
                                final int pos = this.bufposition;
                                int s = 0;
                                for (int i = pos; i < buf.length; i++) {
                                    buf[s++] = buf[i];
                                }
                                int readed = 0;
                                while ((readed += input.read(buf, s + readed, pos - readed)) != pos);
                                this.bufposition = 0;
                                if (Arrays.equals(boundarray, buf)) {
                                    this.end = true;
                                    int c1 = input.read();
                                    int c2 = input.read();
                                    finaled.set(c1 == '-' && c2 == '-');
                                    return true;
                                }
                                return false;
                            }

                            @Override
                            public long skip(long count) throws IOException {
                                if (end) return -1;
                                if (count <= 0) return 0;
                                long s = 0;
                                while (read() != -1) {
                                    s++;
                                    if (--count <= 0) break;
                                }
                                return s;
                            }
                        };
                        this.lastentry = new MultiPart(filename, name, contentType, counter, source);
                        if (fielnameReg != null && !fielnameReg.matcher(filename).matches()) {
                            return this.hasNext();
                        }
                        return true;
                    } else { //不是文件
                        readLine(); //读掉空白
                        params.addValue(parseValue(disposition, "name"), readLine());
                        this.boundaryline = null;
                        this.lastentry = null;
                        return this.hasNext();
                    }
                } catch (IOException ex) {
                    logger.log(Level.FINER, "list multiparts abort", ex);
                    return false;
                }
            }

            @Override
            public MultiPart next() {
                return lastentry;
            }

        };
    }
324373
function () {
            var len = this.source.length,
                char,
                result = '';
            if (this.position >= len) {
                return undefined;
            }
            for (; this.position < len; this.position++) {
                char = this.readNextChars(1);

                if (char === '(' && this.quotes.length === 0) {
                    this.brackets.push(this.position);
                } else if (char === ')' && this.quotes.length === 0) {
                    this.brackets.pop();
                }

                //除这些外，且不在引号内部的特殊字符，都break。Special characters, except the following, and is not in quotes, all break.
                if (['.', ',', '(', ')', '[', ']', '"', "'", ' '].indexOf(char) === -1 && /\W/.test(char) && this.quotes.length === 0) {
                    break;
                }

                //class="@name"   class="@arr.join('')"
                if ((char === '"' || char === "'") && (this.brackets.length === 0 || this.brackets[this.brackets.length - 1] < (this.braces[this.braces.length - 1] || {position: -1}).position)) {
                    break;
                }

                //class="@name abc"   class="@arr.join(' ') abc"
                if (char === ' ' && (this.brackets.length === 0 || this.brackets[this.brackets.length - 1] < (this.braces[this.braces.length - 1] || {position: -1}).position)) {
                    break;
                }

                //class="@name.toString()abc"   class="@arr.join().toString()abc"
                if (char === ')' && [').', ')[', ')]', ')('].indexOf(this.readNextChars(2)) === -1) {
                    result += char;
                    this.position++;
                    break;
                }

                if (char === ']' && ['].', '][', ']]', ']('].indexOf(this.readNextChars(2)) === -1) {
                    result += char;
                    this.position++;
                    break;
                }

                //引号的处理。Handle quotes.
                if ((char === '"' || char === "'") && this.readPrevChars(1) !== '\\') {
                    if (this.quotes.length === 0) {
                        this.quotes.push({
                            type: char === '"' ? quotesEnum.doubleQuotes : quotesEnum.singleQuotes,
                            position: this.position
                        });
                    } else if (this.quotes.length > 0) {
                        if (char === '"' && this.quotes[0].type === quotesEnum.doubleQuotes) {
                            this.quotes.pop();
                        } else if (char === "'" && this.quotes[0].type === quotesEnum.singleQuotes) {
                            this.quotes.pop();
                        }
                    }
                }

                result += char;
            }
            //准备进入前端读取模式。Ready to switch to frontend read mode.
            this.state = stateEnum.client;
            return result;
        }
1336955
private int fetch(State parent, List<Map.Entry<Integer, State>> siblings)
    {
        if (parent.isAcceptable())
        {
            State fakeNode = new State(-(parent.getDepth() + 1));  // 此节点是parent的子节点，同时具备parent的输出
            fakeNode.addEmit(parent.getLargestValueId());
            siblings.add(new AbstractMap.SimpleEntry<Integer, State>(0, fakeNode));
        }
        for (Map.Entry<Character, State> entry : parent.getSuccess().entrySet())
        {
            siblings.add(new AbstractMap.SimpleEntry<Integer, State>(entry.getKey() + 1, entry.getValue()));
        }
        return siblings.size();
    }
58647
public function getLink()
    {
        // Step1 查找出链接
        $link = wei()->navLink()->findId($this->request['id'], $this->request);

        // Step2 验证链接对应的菜单,是否属于当前app
        wei()->nav()->curApp()->findOneById($link['navId']);

        // Step3 如果设置了父链接,检查父链接是否属于当前应用
        if ($link['parentId']) {
            $parentLink = $link->getParentLink();
            wei()->nav()->curApp()->findOneById($parentLink['navId']);
        }

        return $link;
    }
257493
public function getRevResult(){
        if (isset($this->_receive['Status'])) //发送是否成功，具体的返回值请参考 高级群发/模板消息 的事件推送说明
            $array['Status'] = $this->_receive['Status'];
        if (isset($this->_receive['MsgID'])) //发送的消息id
            $array['MsgID'] = $this->_receive['MsgID'];

        //以下仅当群发消息时才会有的事件内容
        if (isset($this->_receive['TotalCount']))     //分组或openid列表内粉丝数量
            $array['TotalCount'] = $this->_receive['TotalCount'];
        if (isset($this->_receive['FilterCount']))    //过滤（过滤是指特定地区、性别的过滤、用户设置拒收的过滤，用户接收已超4条的过滤）后，准备发送的粉丝数
            $array['FilterCount'] = $this->_receive['FilterCount'];
        if (isset($this->_receive['SentCount']))     //发送成功的粉丝数
            $array['SentCount'] = $this->_receive['SentCount'];
        if (isset($this->_receive['ErrorCount']))    //发送失败的粉丝数
            $array['ErrorCount'] = $this->_receive['ErrorCount'];
        if (isset($array) && count($array) > 0) {
            return $array;
        } else {
            return false;
        }
    }
389834
private List<Word>[] toWords(List<Node> leaf){
        List<Word>[] result = new ArrayList[leaf.size()];
        int i = 0;
        if(LOGGER.isDebugEnabled()) {
            LOGGER.debug("全切分结果：");
        }
        for(Node node : leaf){
            result[i++] = toWords(node);
            if(LOGGER.isDebugEnabled()) {
                LOGGER.debug("\t" + i + "：" + result[i - 1]);
            }
        }
        return result;
    }
38922
public String getTypes()    {
		StringBuffer sb = new StringBuffer();
		String ste;
		String[] str;
		for (int i = 0; i < leftChilds.size(); i++) {
			sb.append(leftChilds.get(i).getTypes());
		}
		if(relation!=null)
			sb.append(relation);	
		else
			sb.append("核心词");
		sb.append(" ");
		for (int i = 0; i < rightChilds.size(); i++) {
			sb.append(rightChilds.get(i).getTypes());
		}
				
			return sb.toString();	
	}