Speak a sentence
 @param sentence [String[ sentence to speak
 @param tag [String] optional tag value
 @param gender [String] optional gender of voice
 @param voice [String] optional voice name
765298
def speak_sentence(sentence, tag = nil, gender = "female", voice = "kate")
      play_audio({:gender => gender || "female", :locale => "en_US",
                  :voice => voice || "kate", :sentence => sentence, :tag => tag})
    end
84904
@Override
   public void tag(Annotation sentence) {
      SequenceInput<Annotation> sequenceInput = new SequenceInput<>(sentence.tokens());
      Labeling result = labeler.label(featurizer.extractSequence(sequenceInput.iterator()));
      for (int i = 0; i < sentence.tokenLength(); ) {
         if (result.getLabel(i).equals("O")) {
            i++;
         } else {
            Annotation start = sentence.tokenAt(i);
            String type = result.getLabel(i).substring(2);
            i++;
            while (i < sentence.tokenLength() && result.getLabel(i).startsWith("I-")) {
               i++;
            }
            Annotation end = sentence.tokenAt(i - 1);
            HString span = start.union(end);
            Annotation entity = sentence.document()
                                        .annotationBuilder()
                                        .type(annotationType)
                                        .bounds(span)
                                        .createAttached();
            entity.put(annotationType.getTagAttribute(),
                       annotationType.getTagAttribute().getValueType().decode(type));
         }
      }
   }
613034
def segment_sentences(self, sentences, lower=True, use_stop_words=True, use_speech_tags_filter=False):
        

        res = []
        for sentence in sentences:
            res.append(self.segment(text=sentence,
                                    lower=lower,
                                    use_stop_words=use_stop_words,
                                    use_speech_tags_filter=use_speech_tags_filter))
        return res
875097
def say_response(speech, end_session = true, ssml = false)
      output_speech = add_speech(speech,ssml)
      { :outputSpeech => output_speech, :shouldEndSession => end_session }
    end
1320343
def get_sentences(self, root_element, block_tags):
        """"""
        sentences = []
        for element in root_element:
            if not self.any_ends_with(block_tags, element.tag):
                # tag not in block_tags
                if element.text is not None and not re.match('^\s*$',
                                                             element.text):
                    sentences.extend(self.sentence_tokenize(element.text))
                sentences.extend(self.get_sentences(element, block_tags))

        f = open('sentence_debug.txt', 'w')
        for s in sentences:
            f.write(s.lower() + '\n')
        f.close()
        return sentences
434223
def send_speaking(value)
      @bot.debug("Speaking: #{value}")
      @client.send({
        op: 5,
        d: {
          speaking: value,
          delay: 0
        }
      }.to_json)
    end
200455
public void add(Sentence sentence) {
        if (sentence.getAlphabet() != alphabet) {
            throw new IllegalArgumentException("Alphabets do not match.");
        }
        addSentenceToAlphabet(sentence);
        sents.add(sentence);
        numTokens += sentence.size();
    }
1337422
public void speak (String arg1, byte arg2)
    {
        sendRequest(SPEAK, new Object[] {
            arg1, Byte.valueOf(arg2)
        });
    }
687798
def sentence_starts(self):
        """"""
        if not self.is_tagged(SENTENCES):
            self.tokenize_sentences()
        return self.starts(SENTENCES)
769757
@Override
    protected List<Term> segSentence(char[] sentence)
    {
        if (sentence.length == 0) return Collections.emptyList();
        List<Term> termList = roughSegSentence(sentence);
        if (!(config.ner || config.useCustomDictionary || config.speechTagging))
            return termList;
        List<Vertex> vertexList = toVertexList(termList, true);
        if (config.speechTagging)
        {
            Viterbi.compute(vertexList, CoreDictionaryTransformMatrixDictionary.transformMatrixDictionary);
            int i = 0;
            for (Term term : termList)
            {
                if (term.nature != null) term.nature = vertexList.get(i + 1).guessNature();
                ++i;
            }
        }
        if (config.useCustomDictionary)
        {
            combineByCustomDictionary(vertexList);
            termList = convert(vertexList, config.offset);
        }
        return termList;
    }
854968
public void setVoices(java.util.Collection<Voice> voices) {
        if (voices == null) {
            this.voices = null;
            return;
        }

        this.voices = new java.util.ArrayList<Voice>(voices);
    }
502181
def tag(tokens)
      !tokens.is_a?(Array) && !tokens.is_a?(String) &&
        raise(ArgumentError, 'tokens must be an instance of String or Array')

      j_instance.tag(tokens.to_java(:String))
    end
207298
function tokenize_sentence(sentence) {
  var tokenized = tokenizer.tokenize(sentence);
  logger.info("tokenize_sentence: " + tokenized);
  return(tokenized);
}
1205482
public synchronized List<Sentence> sentences(String text) {
        requireValidHandle();
        Libvoikko lib = getLib();
        List<Sentence> result = new ArrayList<Sentence>();
        if (!isValidInput(text)) {
            result.add(new Sentence(text, SentenceStartType.NONE));
            return result;
        }
        byte[] textBytes = s2n(text);
        int textLen = textBytes.length - 1;
        SizeTByReference sentenceLenByRef = new SizeTByReference();
        while (textLen > 0) {
            int sentenceTypeInt = lib.voikkoNextSentenceStartCstr(handle, textBytes, new SizeT(textLen), sentenceLenByRef);
            int sentenceLen = sentenceLenByRef.getValue().intValue();
            SentenceStartType sentenceType = SentenceStartType.values()[sentenceTypeInt];
            String tokenText = text.substring(0, sentenceLen);
            result.add(new Sentence(tokenText, sentenceType));
            text = text.substring(sentenceLen);
            textBytes = s2n(text);
            textLen = textBytes.length - 1;
        }
        return result;
    }
77396
public void setGender(String v) {
    if (PronounFeats_Type.featOkTst && ((PronounFeats_Type)jcasType).casFeat_gender == null)
      jcasType.jcas.throwFeatMissing("gender", "de.julielab.jules.types.PronounFeats");
    jcasType.ll_cas.ll_setStringValue(addr, ((PronounFeats_Type)jcasType).casFeatCode_gender, v);}
262053
public void trainSentence(final List<VocabWord> sentence, double alpha) {
        if (sentence != null && !sentence.isEmpty()) {
            for (int i = 0; i < sentence.size(); i++) {
                if (!sentence.get(i).getWord().endsWith("STOP")) {
                    nextRandom.set(nextRandom.get() * 25214903917L + 11);
                    skipGram(i, sentence, (int) nextRandom.get() % window, alpha);
                }
            }
        }

    }
17324
public AnalyzedSentence getRawAnalyzedSentence(String sentence) throws IOException {
    List<String> tokens = language.getWordTokenizer().tokenize(sentence);
    Map<Integer, String> softHyphenTokens = replaceSoftHyphens(tokens);

    List<AnalyzedTokenReadings> aTokens = language.getTagger().tag(tokens);
    if (language.getChunker() != null) {
      language.getChunker().addChunkTags(aTokens);
    }
    int numTokens = aTokens.size();
    int posFix = 0; 
    for (int i = 1; i < numTokens; i++) {
      aTokens.get(i).setWhitespaceBefore(aTokens.get(i - 1).isWhitespace());
      aTokens.get(i).setStartPos(aTokens.get(i).getStartPos() + posFix);
      if (!softHyphenTokens.isEmpty() && softHyphenTokens.get(i) != null) {
        aTokens.get(i).addReading(language.getTagger().createToken(softHyphenTokens.get(i), null));
        posFix += softHyphenTokens.get(i).length() - aTokens.get(i).getToken().length();
      }
    }
        
    AnalyzedTokenReadings[] tokenArray = new AnalyzedTokenReadings[tokens.size() + 1];
    AnalyzedToken[] startTokenArray = new AnalyzedToken[1];
    int toArrayCount = 0;
    AnalyzedToken sentenceStartToken = new AnalyzedToken("", SENTENCE_START_TAGNAME, null);
    startTokenArray[0] = sentenceStartToken;
    tokenArray[toArrayCount++] = new AnalyzedTokenReadings(startTokenArray, 0);
    int startPos = 0;
    for (AnalyzedTokenReadings posTag : aTokens) {
      posTag.setStartPos(startPos);
      tokenArray[toArrayCount++] = posTag;
      startPos += posTag.getToken().length();
    }

    // add additional tags
    int lastToken = toArrayCount - 1;
    // make SENT_END appear at last not whitespace token
    for (int i = 0; i < toArrayCount - 1; i++) {
      if (!tokenArray[lastToken - i].isWhitespace()) {
        lastToken -= i;
        break;
      }
    }

    tokenArray[lastToken].setSentEnd();

    if (tokenArray.length == lastToken + 1 && tokenArray[lastToken].isLinebreak()) {
      tokenArray[lastToken].setParagraphEnd();
    }
    return new AnalyzedSentence(tokenArray);
  }