class_docstr: Apply the Moses Tokenizer/Detokenizer implemented in
   [sacremoses](https://github.com/alvations/sacremoses).
  
  .. note::
      sacremoses carries an LGPL 2.1+ license.
  
  Parameters
  ----------
  lang
      The language of the input.
class_docstr_tok: ["Apply","the","Moses","Tokenizer\/Detokenizer","implemented","in","[","sacremoses","]","(","https",":","\/\/github.com\/alvations\/sacremoses",")",".","..","note",":",":","sacremoses","carries","an","LGPL","2.1+","license",".","Parameters","--","--","--","--","--","lang","The","language","of","the","input","."]
code: def decode(self, tokens):
      is_multiple_sentences = is_tokens_from_multiple_sentences(tokens)
      if not is_multiple_sentences:
          tokens = [tokens]
      token_type = get_token_type(tokens)
      if token_type is str:
          ret = [
              self._detokenizer.detokenize(ele_tokens, return_str=True)
              for ele_tokens in tokens
          ]
      elif token_type is int:
          if self._vocab is None:
              raise TokenizerDecodeWithoutVocabError
          ret = [
              self._detokenizer.detokenize(
                  self._vocab.to_tokens(ele_tokens), return_str=True
              )
              for ele_tokens in tokens
          ]
      else:
          raise TokenTypeNotSupportedError(token_type)
      if is_multiple_sentences:
          return ret
      else:
          return ret[0]
  
file_path: gluon-nlp/src/gluonnlp/data/tokenizers/moses.py
imports: from typing import Optional
  import warnings
  import sacremoses
  from .base import TOKENIZER_REGISTRY, BaseTokenizerWithVocab, TokenizerEncodeWithoutVocabError, TokenizerDecodeWithoutVocabError, TokenTypeNotSupportedError, is_tokens_from_multiple_sentences, get_token_type
  from ..vocab import Vocab
label_desc: Use image node_id 5 for calling the MosesTokenizer obj's underlying member method code with example usage: obj.decode(tokens) and returns: ret, ret