获取代理的词法分析器

@return
511869
public LexicalAnalyzer getAnalyzer()
    {
        for (Pipe<List<IWord>, List<IWord>> pipe : this)
        {
            if (pipe instanceof LexicalAnalyzerPipe)
            {
                return ((LexicalAnalyzerPipe) pipe).analyzer;
            }
        }
        return null;
    }
43358
public ArrayList<String> getFeatures() {
		if (isFinalState())
			return null;
		ArrayList<String> featurelist = new ArrayList<String>();

		int rightFocus = leftFocus + 1;

//		ISparseVector vec = new HashSparseVector();
		//所有的联合feature
		featurelist.add(combinedFeature("+0+1", POS, new int[]{0, 1}));
		featurelist.add(combinedFeature("-1+0+1", POS, new int[]{-1, 0, 1}));
		featurelist.add(combinedFeature("+0+1+2", POS, new int[]{0, 1, 2}));
		featurelist.add(combinedFeature("+1+2+3", POS, new int[]{1, 2, 3}));
		featurelist.add(combinedFeature("-2+3+4", POS, new int[]{2, 3, 4}));
		featurelist.add(combinedFeature("+0+1", LEX, new int[]{0, 1}));
		featurelist.add(combinedFeature("-1+0+1", LEX, new int[]{-1, 0, 1}));
		featurelist.add(combinedFeature("+0+1+2", LEX, new int[]{0, 1, 2}));

		// 设定上下文窗口大小
		int l = 2;
		int r = 4;
		for (int i = 0; i <= l; i++) {
			// 特征前缀
			String posFeature = "-" + String.valueOf(i) + POS;
			String lexFeature = "-" + String.valueOf(i) + LEX;

			String lcLexFeature = "-" + String.valueOf(i)
					+ CH_L_LEX;
			String lcPosFeature = "-" + String.valueOf(i)
					+ CH_L_POS;
			String rcLexFeature = "-" + String.valueOf(i)
					+ CH_R_LEX;
			String rcPosFeature = "-" + String.valueOf(i)
					+ CH_R_POS;
			String lcDepFeature = "-" + String.valueOf(i)
					+ CH_L_DEP;			
			String rcDepFeature = "-" + String.valueOf(i)
					+ CH_R_DEP;

			if (leftFocus - i < 0) {
				featurelist.add(lexFeature + START + String.valueOf(i - leftFocus));
				featurelist.add(posFeature + START + String.valueOf(i - leftFocus));
			} else {
				featurelist.add(lexFeature + sent.words[trees.get(leftFocus - i).id]);
				featurelist.add(posFeature + sent.tags[trees.get(leftFocus - i).id]);

				if (trees.get(leftFocus - i).leftChilds.size() != 0) {
					for (int j = 0; j < trees.get(leftFocus - i).leftChilds
							.size(); j++) {
						int leftChildIndex = trees.get(leftFocus - i).leftChilds
								.get(j).id;
						featurelist.add(lcLexFeature
								+ sent.words[leftChildIndex]);
						featurelist.add(lcPosFeature
								+ sent.tags[leftChildIndex]);
						featurelist.add(lcDepFeature
								+ sent.getDepClass(leftChildIndex));
					}
				}else{
					featurelist.add(lcLexFeature + NULL);
					featurelist.add(lcPosFeature + NULL);
				}

				if (trees.get(leftFocus - i).rightChilds.size() != 0) {
					for (int j = 0; j < trees.get(leftFocus - i).rightChilds
							.size(); j++) {
						int rightChildIndex = trees.get(leftFocus - i).rightChilds
								.get(j).id;
						featurelist.add(rcLexFeature
								+ sent.words[rightChildIndex]);
						featurelist.add(rcPosFeature
								+ sent.tags[rightChildIndex]);
						featurelist.add(rcDepFeature
								+ sent.getDepClass(rightChildIndex));
					}
				}else{
					featurelist.add(rcLexFeature + NULL);
					featurelist.add(rcPosFeature + NULL);
				}
			}
		}

		for (int i = 0; i <= r; i++) {
			String posFeature = "+" + String.valueOf(i) + POS;
			String lexFeature = "+" + String.valueOf(i) + LEX;

			String lcLexFeature = "+" + String.valueOf(i)
					+ CH_L_LEX;
			String rcLexFeature = "+" + String.valueOf(i)
					+ CH_R_LEX;
			String lcPosFeature = "+" + String.valueOf(i)
					+ CH_L_POS;			
			String rcPosFeature = "+" + String.valueOf(i)
					+ CH_R_POS;
			String lcDepFeature = "+" + String.valueOf(i)
					+ CH_L_DEP;			
			String rcDepFeature = "+" + String.valueOf(i)
					+ CH_R_DEP;

			if (rightFocus + i >= trees.size()) {
				featurelist.add(lexFeature+ END+ String.valueOf(rightFocus + i- trees.size() + 3));
				featurelist.add(posFeature+ END+ String.valueOf(rightFocus + i- trees.size() + 3));
			} else {
				featurelist.add(lexFeature+ sent.words[trees.get(rightFocus + i).id]);
				featurelist.add(posFeature+ sent.tags[trees.get(rightFocus + i).id]);

				if (trees.get(rightFocus + i).leftChilds.size() != 0) {
					for (int j = 0; j < trees.get(rightFocus + i).leftChilds
							.size(); j++) {
						int leftChildIndex = trees.get(rightFocus + i).leftChilds
								.get(j).id;
						featurelist.add(lcLexFeature+ sent.words[leftChildIndex]);
						featurelist.add(lcPosFeature+ sent.tags[leftChildIndex]);
						featurelist.add(lcDepFeature+ sent.getDepClass(leftChildIndex));
					}
				}else{
					featurelist.add(lcLexFeature + NULL);
					featurelist.add(lcPosFeature + NULL);
				}

				if (trees.get(rightFocus + i).rightChilds.size() != 0) {
					for (int j = 0; j < trees.get(rightFocus + i).rightChilds
							.size(); j++) {
						int rightChildIndex = trees.get(rightFocus + i).rightChilds
								.get(j).id;
						featurelist.add(rcLexFeature+ sent.words[rightChildIndex]);
						featurelist.add(rcPosFeature+ sent.tags[rightChildIndex]);
						featurelist.add(rcDepFeature+ sent.getDepClass(rightChildIndex));
					}
				}else{
					featurelist.add(rcLexFeature + NULL);
					featurelist.add(rcPosFeature + NULL);
				}
			}
		}
		
		
		return featurelist;
	}
653648
private TreeControl getTreeControl(HttpServletRequest request) throws
      Exception {
    HttpSession session = request.getSession();
    TreeControl control = (TreeControl) session.getAttribute(TreeControlTag.
        TREE_NAME);
    try{
      //第一次调用
      if ( (control == null) || (request.getParameterMap().isEmpty())) {
        Debug.logVerbose("[JdonFramework] get tree from db..", module);
        ViewNode root =  getRootViewNode(request);
        control = new TreeControl(root);
        fetchRootChildern(request, root);
        session.setAttribute(TreeControlTag.TREE_NAME, control);
      }
    }catch(Exception ex){
      Debug.logError("[JdonFramework] getTreeControl error: " + ex, module);
    }
    return  control;
  }
668546
private static String[] getHttpMethodAndPath(Method method) {
		if(null == method){
			return null;
		}
		
		String[] httpMethodAndPath;
		Route routeAnnotation = method.getAnnotation(Route.class);
		if(null != routeAnnotation){//从Annotation中获取HttpMethod和路径
			httpMethodAndPath = getHttpMethodAndPath(routeAnnotation);
			if(null != httpMethodAndPath[0] && StrUtil.isBlank(httpMethodAndPath[1])){
				//对于"post:"这类Route，依旧使用方法名做为路径一部分
				httpMethodAndPath[1] = method.getName();
			}
		}else{
			httpMethodAndPath = new String[]{null, method.getName()};
		}
		return httpMethodAndPath;
	}
283450
private List<Group> getGroups() throws Exception {
        List<Group> groups = new ArrayList<Group>();
        List<Group> sourceGroups = PathOverrideService.getInstance().findAllGroups();

        // loop through the groups
        for (Group sourceGroup : sourceGroups) {
            Group group = new Group();

            // add all methods
            ArrayList<Method> methods = new ArrayList<Method>();
            for (Method sourceMethod : EditService.getInstance().getMethodsFromGroupId(sourceGroup.getId(), null)) {
                Method method = new Method();
                method.setClassName(sourceMethod.getClassName());
                method.setMethodName(sourceMethod.getMethodName());
                methods.add(method);
            }

            group.setMethods(methods);
            group.setName(sourceGroup.getName());
            groups.add(group);
        }

        return groups;
    }
363973
public Map<String, Method> methods() {
        if (this.methodHolder.isPresent()) {
            return this.methodHolder.get();
        }
        
        Map<String, Method> methodMap = Maps.newHashMap();
        Class<?> currentClass = delegateClass();
        
        while (currentClass != null) {
            for (Method m : currentClass.getDeclaredMethods()) {
                m.setAccessible(true);
                methodMap.put(m.getName(), m);
            }
            
            currentClass = currentClass.getSuperclass();
        }
        
        return (this.methodHolder = Optional.of(methodMap)).get();
    }
669740
public List<InitMethodType<SessionBeanType<T>>> getAllInitMethod()
   {
      List<InitMethodType<SessionBeanType<T>>> list = new ArrayList<InitMethodType<SessionBeanType<T>>>();
      List<Node> nodeList = childNode.get("init-method");
      for(Node node: nodeList)
      {
         InitMethodType<SessionBeanType<T>>  type = new InitMethodTypeImpl<SessionBeanType<T>>(this, "init-method", childNode, node);
         list.add(type);
      }
      return list;
   }
631819
public Collection<CServiceMethod> getMethodsIncludingExtended() {
        CService extended = getExtendsService();
        if (extended == null) {
            return getMethods();
        }
        List<CServiceMethod> out = new ArrayList<>();
        out.addAll(extended.getMethodsIncludingExtended());
        out.addAll(getMethods());
        return ImmutableList.copyOf(out);
    }
869571
public List<Node<Scope>> toList() {
        List<Node<Scope>> list = new ArrayList<Node<Scope>>();
        walk(rootElement, list);
        return list;
    }
1080712
public BshMethod[] getMethods() {
        return this.methods.values().stream()
                .flatMap(v -> v.stream()).toArray(BshMethod[]::new);
    }
67965
public int getSeconds() {
		// TODO ahai 未做测试
		Calendar cld = Calendar.getInstance();
		cld.set(Calendar.DAY_OF_WEEK, this.weekday + 1);
		cld.set(Calendar.HOUR_OF_DAY, this.hour);
		cld.set(Calendar.MINUTE, this.minute);
		cld.set(Calendar.SECOND, this.second);
		long time = cld.getTimeInMillis();
		// System.out.println("time:" +
		// DateUtil.getTime(DateUtil.toDate(time)));
		long diff = time - System.currentTimeMillis();
		if (diff <= 0) {// 一定要小于等于0
			// 本周的时间已过，下周再执行
			diff += 7 * 24 * 60 * 60 * 1000L;
		}
		int seconds = (int) (diff / 1000);
		return seconds;
	}
215406
function () {
                var self = this, cs = [], i, c = self.constructor, attrs = self.getAttrs();
                while (c) {
                    cs.push(c);
                    c = c.superclass && c.superclass.constructor;
                }
                cs.reverse();    // from super class to sub class
                // from super class to sub class
                for (i = 0; i < cs.length; i++) {
                    var ATTRS = cs[i].ATTRS || {};
                    for (var attributeName in ATTRS) {
                        if (attributeName in attrs) {
                            var attributeValue, onSetMethod;
                            var onSetMethodName = ON_SET + ucfirst(attributeName);    // 存在方法，并且用户设置了初始值或者存在默认值，就同步状态
                            // 存在方法，并且用户设置了初始值或者存在默认值，就同步状态
                            if ((onSetMethod = self[onSetMethodName]) && // 用户如果设置了显式不同步，就不同步，
                                // 比如一些值从 html 中读取，不需要同步再次设置
                                attrs[attributeName].sync !== 0 && (attributeValue = self.get(attributeName)) !== undefined) {
                                onSetMethod.call(self, attributeValue);
                            }
                        }
                    }
                }
            }
2561
protected Map<ProviderInfo, ClientTransport> clearProviders() {
        providerLock.lock();
        try {
            // 当前存活+重试的
            HashMap<ProviderInfo, ClientTransport> all = new HashMap<ProviderInfo, ClientTransport>(aliveConnections);
            all.putAll(subHealthConnections);
            all.putAll(retryConnections);
            all.putAll(uninitializedConnections);
            subHealthConnections.clear();
            aliveConnections.clear();
            retryConnections.clear();
            uninitializedConnections.clear();
            return all;
        } finally {
            providerLock.unlock();
        }
    }
1027656
public Graph toGraph()
    {
        Graph graph = new Graph(getVertexesLineFirst());

        for (int row = 0; row < vertexes.length - 1; ++row)
        {
            List<Vertex> vertexListFrom = vertexes[row];
            for (Vertex from : vertexListFrom)
            {
                assert from.realWord.length() > 0 : "空节点会导致死循环！";
                int toIndex = row + from.realWord.length();
                for (Vertex to : vertexes[toIndex])
                {
                    graph.connect(from.index, to.index, MathUtility.calculateWeight(from, to));
                }
            }
        }
        return graph;
    }
703347
public Map<String, String> toMap() {
		Element root = doc.getDocumentElement();
		Map<String, String> params = new HashMap<String, String>();

		// 将节点封装成map形式
		NodeList list = root.getChildNodes();
		for (int i = 0; i < list.getLength(); i++) {
			Node node = list.item(i);
			params.put(node.getNodeName(), node.getTextContent());
		}
		// 含有空白符会生成一个#text参数
		params.remove("#text");
		return params;
	}
1263270
public static function method() {
        // $this->methodParam 默认值为 '_method'
        // 如果指定 $_POST['_method'] ，表示使用POST请求来模拟其他方法的请求。
        // 此时 $_POST['_method'] 即为所模拟的请求类型。
        if (isset($_POST[$this->methodParam])) {
            return strtoupper($_POST[$this->methodParam]);
            // 或者使用 $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] 的值作为方法名。
        } elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
            return strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);
            // 或者使用 $_SERVER['REQUEST_METHOD'] 作为方法名，未指定时，默认为 GET 方法
        } else {
            return isset($_SERVER['REQUEST_METHOD']) ? strtoupper($_SERVER['REQUEST_METHOD']) : 'GET';
        }
    }
828685
public Set<HttpMethod> getAllow() {
		String value = getFirst(ALLOW);
		if (!StringUtils.isEmpty(value)) {
			List<HttpMethod> allowedMethod = new ArrayList<HttpMethod>(5);
			String[] tokens = value.split(",\\s*");
			for (String token : tokens) {
				allowedMethod.add(HttpMethod.valueOf(token));
			}
			return EnumSet.copyOf(allowedMethod);
		}
		else {
			return EnumSet.noneOf(HttpMethod.class);
		}
	}