按照 PartOfSpeechTagDictionary 指定的映射表将词语词性翻译过去

@return
428450
public Sentence translateLabels()
    {
        for (IWord word : wordList)
        {
            word.setLabel(PartOfSpeechTagDictionary.translate(word.getLabel()));
            if (word instanceof CompoundWord)
            {
                for (Word child : ((CompoundWord) word).innerList)
                {
                    child.setLabel(PartOfSpeechTagDictionary.translate(child.getLabel()));
                }
            }
        }
        return this;
    }
851903
public List<MessageDestinationType<WebFragmentDescriptor>> getAllMessageDestination()
   {
      List<MessageDestinationType<WebFragmentDescriptor>> list = new ArrayList<MessageDestinationType<WebFragmentDescriptor>>();
      List<Node> nodeList = model.get("message-destination");
      for(Node node: nodeList)
      {
         MessageDestinationType<WebFragmentDescriptor>  type = new MessageDestinationTypeImpl<WebFragmentDescriptor>(this, "message-destination", model, node);
         list.add(type);
      }
      return list;
   }
530988
String getRemarks() {

        if (!locale_set) {
            setLocale(Locale.getDefault());
        }

        String key = this.getTypeName();

        return BundleHandler.getString(hnd_remarks, key);
    }
359574
public String[] toWordArray()
    {
        List<Word> wordList = toSimpleWordList();
        String[] wordArray = new String[wordList.size()];
        Iterator<Word> iterator = wordList.iterator();
        for (int i = 0; i < wordArray.length; i++)
        {
            wordArray[i] = iterator.next().value;
        }
        return wordArray;
    }
543917
public String getAnnotations() {
    StringBuilder sb = new StringBuilder(40);
    sb.append("Disambiguator log: \n");
    for (AnalyzedTokenReadings element : tokens) {
      if (!element.isWhitespace() &&
              !"".equals(element.getHistoricalAnnotations())) {
        sb.append(element.getHistoricalAnnotations());
        sb.append('\n');
      }
    }
    return sb.toString();
  }
830465
public List<WordLemmaTag> getStanfordWordLemmaTags() {
        List<AgigaToken> tokens = getTokens();
        List<WordLemmaTag> labels = new ArrayList<WordLemmaTag>();
        for (int i = 0; i < tokens.size(); i++) {
            AgigaToken at = tokens.get(i);
            WordLemmaTag curToken;
            require(prefs.readWord, "AgigaPrefs.readWord must be true for getStanfordWordLemmaTags()");
            if (prefs.readWord && prefs.readLemma && prefs.readPos) {
                curToken = new WordLemmaTag(at.getWord(), at.getLemma(), at.getPosTag());
            } else if (prefs.readWord && prefs.readPos) {
                curToken = new WordLemmaTag(at.getWord(), at.getPosTag());
            } else { // if (prefs.readWord) {
                curToken = new WordLemmaTag(at.getWord());
            }
            labels.add(curToken);
        }
        return labels;
    }
1125787
public List<VocabularyWord> updateHuffmanCodes() {
        int min1i;
        int min2i;
        int b;
        int i;
        // get vocabulary as sorted list
        List<VocabularyWord> vocab = this.words();
        int count[] = new int[vocab.size() * 2 + 1];
        int parent_node[] = new int[vocab.size() * 2 + 1];
        byte binary[] = new byte[vocab.size() * 2 + 1];

        // at this point vocab is sorted, with descending order
        for (int a = 0; a < vocab.size(); a++)
            count[a] = vocab.get(a).getCount();
        for (int a = vocab.size(); a < vocab.size() * 2; a++)
            count[a] = Integer.MAX_VALUE;
        int pos1 = vocab.size() - 1;
        int pos2 = vocab.size();
        for (int a = 0; a < vocab.size(); a++) {
            // First, find two smallest nodes 'min1, min2'
            if (pos1 >= 0) {
                if (count[pos1] < count[pos2]) {
                    min1i = pos1;
                    pos1--;
                } else {
                    min1i = pos2;
                    pos2++;
                }
            } else {
                min1i = pos2;
                pos2++;
            }
            if (pos1 >= 0) {
                if (count[pos1] < count[pos2]) {
                    min2i = pos1;
                    pos1--;
                } else {
                    min2i = pos2;
                    pos2++;
                }
            } else {
                min2i = pos2;
                pos2++;
            }
            count[vocab.size() + a] = count[min1i] + count[min2i];
            parent_node[min1i] = vocab.size() + a;
            parent_node[min2i] = vocab.size() + a;
            binary[min2i] = 1;
        }

        // Now assign binary code to each vocabulary word
        byte[] code = new byte[MAX_CODE_LENGTH];
        int[] point = new int[MAX_CODE_LENGTH];

        for (int a = 0; a < vocab.size(); a++) {
            b = a;
            i = 0;
            byte[] lcode = new byte[MAX_CODE_LENGTH];
            int[] lpoint = new int[MAX_CODE_LENGTH];
            while (true) {
                code[i] = binary[b];
                point[i] = b;
                i++;
                b = parent_node[b];
                if (b == vocab.size() * 2 - 2)
                    break;
            }

            lpoint[0] = vocab.size() - 2;
            for (b = 0; b < i; b++) {
                lcode[i - b - 1] = code[b];
                lpoint[i - b] = point[b] - vocab.size();
            }

            vocab.get(a).setHuffmanNode(new HuffmanNode(lcode, lpoint, a, (byte) i));
        }

        idxMap.clear();
        for (VocabularyWord word : vocab) {
            idxMap.put(word.getHuffmanNode().getIdx(), word);
        }

        return vocab;
    }
81767
public Sentence translateCompoundWordLabels()
    {
        for (IWord word : wordList)
        {
            if (word instanceof CompoundWord)
                word.setLabel(PartOfSpeechTagDictionary.translate(word.getLabel()));
        }
        return this;
    }
116432
private IContext findMultiwordsInContextStructure(IContext context) throws ContextPreprocessorException {
        for (Iterator<INode> i = context.getNodes(); i.hasNext(); ) {
            INode sourceNode = i.next();
            // sense disambiguation within the context structure
            // for all ACoLs in the source node
            for (Iterator<IAtomicConceptOfLabel> j = sourceNode.getNodeData().getACoLs(); j.hasNext(); ) {
                IAtomicConceptOfLabel synSource = j.next();
                // in all descendants and ancestors
                findMultiwordsAmong(sourceNode.getDescendants(), synSource);
                findMultiwordsAmong(sourceNode.getAncestors(), synSource);
            }
        }
        return context;
    }
1306118
public QuestionStructure getMainPart(String question, String questionWords) {
        List<edu.stanford.nlp.ling.Word> words = new ArrayList<>();
        String[] qw = questionWords.split("\\s+");
        for (String item : qw) {
            item = item.trim();
            if ("".equals(item)) {
                continue;
            }
            words.add(new edu.stanford.nlp.ling.Word(item));
        }
        return getMainPart(question, words);
    }
555087
public String getDictCanon() {
    if (DictTerm_Type.featOkTst && ((DictTerm_Type)jcasType).casFeat_DictCanon == null)
      jcasType.jcas.throwFeatMissing("DictCanon", "org.apache.uima.conceptMapper.DictTerm");
    return jcasType.ll_cas.ll_getStringValue(addr, ((DictTerm_Type)jcasType).casFeatCode_DictCanon);}
646416
public String getDescription() {
        val items = getDescriptions();
        if (items.isEmpty()) {
            return this.registeredService.getDescription();
        }
        return StringUtils.collectionToDelimitedString(items, ".");
    }
1133228
public String getGramRole() {
    if (PTBConstituent_Type.featOkTst && ((PTBConstituent_Type)jcasType).casFeat_gramRole == null)
      jcasType.jcas.throwFeatMissing("gramRole", "de.julielab.jules.types.PTBConstituent");
    return jcasType.ll_cas.ll_getStringValue(addr, ((PTBConstituent_Type)jcasType).casFeatCode_gramRole);}
717876
public boolean readDict(){
		try {
			URL url = POSContextGenerator.class.getClassLoader().getResource(DEFAULT_E_DICT);
			BufferedReader reader = new BufferedReader(new InputStreamReader(
					url.openStream(), "UTF-8"));
			word2dictags.clear();
						
			String line, temp = null;
			while ((line = reader.readLine()) != null ){
				String [] tokens = line.split("\t");
		
				String word, tag;
				if (tokens == null)
					continue;
				
				if (tokens.length != 2){
					continue;					
				}
				else if (tokens.length == 2){
					if (tokens[0].equals("")){
						if (temp == null)
							continue;
						else {
							//System.out.println(temp);
							word = temp;
							tag = tokens[1];
						}
					}
					else{ 
						word = tokens[0].trim().toLowerCase();
						tag = tokens[1].trim();
						temp = word;
					}
				}
				else continue;
				
				word = word.replace(" ","_");
				//System.out.println(word);
				List dictags = (List) word2dictags.get(word);
				if (dictags == null){
					dictags = new ArrayList<String>();
				}
				dictags.add(tag);
				word2dictags.put(word, dictags);
			}
			
			reader.close();
			return true;
		}
		
		catch (Exception e){
			System.out.println(e.getMessage());
			e.printStackTrace();
			return false;
		}
	}
893979
public Part getPart(String partLabel)
  {
    if (m_parts!=null)
    {
        for (Object m_part : m_parts) {
            Part p = (Part) m_part;
            //if (p.getLabel().equals(partLabel)
            //	|| p.getLabel().equals(""+partLabel.charAt(0))) {
            if (p.getLabel().charAt(0) == partLabel.charAt(0)) {
                if (partLabel.length() > 1) {
                    p.setLabel(partLabel);
                }
                return p;
            }
        }
    	return null;
    }
    else
      return null;
  }
386052
private HashMap<List<String>, String> getDictMap(final String word,
      final String postag) {
    HashMap<List<String>, String> dictMap = new HashMap<List<String>, String>();
    dictMap = this.getLemmaTagsDict(word.toLowerCase());
    return dictMap;
  }
324953
public String getList() {
    String result = "";
    int i = 1;

    for (String s : mReps.keySet()) {
      result += (i++) + ". key='" + s + "', value='" + mReps.get(s) + "'\n";
    }

    return result;
  }