code: private boolean openTemplate(String filename)
      {
          InputStreamReader isr = null;
          try
          {
              isr = new InputStreamReader(IOUtil.newInputStream(filename), "UTF-8");
              BufferedReader br = new BufferedReader(isr);
              String line;
              while ((line = br.readLine()) != null)
              {
                  if (line.length() == 0 || line.charAt(0) == ' ' || line.charAt(0) == '#')
                  {
                      continue;
                  }
                  else if (line.charAt(0) == 'U')
                  {
                      unigramTempls_.add(line.trim());
                  }
                  else if (line.charAt(0) == 'B')
                  {
                      bigramTempls_.add(line.trim());
                  }
                  else
                  {
                      System.err.println("unknown type: " + line);
                  }
              }
              br.close();
              templs_ = makeTempls(unigramTempls_, bigramTempls_);
          }
          catch (Exception e)
          {
              if (isr != null)
              {
                  try
                  {
                      isr.close();
                  }
                  catch (Exception e2)
                  {
                  }
              }
              e.printStackTrace();
              System.err.println("Error reading " + filename);
              return false;
          }
          return true;
      }
docs: 读取特征模板文件
  
  @param filename
  @return