docs: public void addTemplate(String strTemplate, int weight) throws Exception {
  		strTemplate = strTemplate.replaceAll("[\\?\\*\\[\\]\\{\\}\\,\\|]", "");
  //		if(strTemplate.contains("."))
  //			System.out.println(strTemplate);
  		strTemplate = strTemplate.replaceAll("\\.", "\\\\.");
  		
  		Pattern p = Pattern.compile("(#[^#]+#)+");
  		Matcher m = p.matcher(strTemplate);
  		if(m.matches())
  			return;
  		
  //		strTemplate = "^"+strTemplate;
  //		strTemplate += "$";
  		
  		String str = new String(strTemplate);
  		ArrayList<String> matchs = new ArrayList<String>();
  		int len = 0;
  		int patternNum = 0;
  		while(m.find()) {
  			patternNum++;
  			String target = m.group();
  			len+=target.length();
  			matchs.add(target);
  			str = str.replace(target, "(.{"+minlen+",})");
  		}
  		len = str.length()-len;
  		if(len<2)
  			return;
  		
  		templates.add(strTemplate);
  		lens.add(len);
  		weights.add((float) (weight*Math.pow(BASE, Math.max(0,2-patternNum))));
  		matchGroup.add(matchs);
  		//System.out.println(str);
  		try {
  			patterns.add(Pattern.compile(str));
  		} catch (Exception e) {
  			System.out.println(str);
  			e.printStackTrace();
  			throw e;
  		}
  	}