class_docstr: Syllabifies words based on the Legality Principle and Onset Maximization.
  
      >>> from nltk.tokenize import LegalitySyllableTokenizer
      >>> from nltk import word_tokenize
      >>> from nltk.corpus import words
      >>> text = "This is a wonderful sentence."
      >>> text_words = word_tokenize(text)
      >>> LP = LegalitySyllableTokenizer(words.words())
      >>> [LP.tokenize(word) for word in text_words]
      [['This'], ['is'], ['a'], ['won', 'der', 'ful'], ['sen', 'ten', 'ce'], ['.']]
docstr: :param tokenized_source_text: List of valid tokens in the language
  :type tokenized_source_text: list(str)
  :param vowels: Valid vowels in language or IPA representation
  :type vowels: str
  :param legal_frequency_threshold: Lowest frequency of all onsets to be considered a legal onset
  :type legal_frequency_threshold: float
docstr_tok: [":","param","tokenized_source_text",":","List","of","valid","tokens","in","the","language",":","type","tokenized_source_text",":","list","(","str",")",":","param","vowels",":","Valid","vowels","in","language","or","IPA","representation",":","type","vowels",":","str",":","param","legal_frequency_threshold",":","Lowest","frequency","of","all","onsets","to","be","considered","a","legal","onset",":","type","legal_frequency_threshold",":","float"]
code: def __init__(
      self,
      tokenized_source_text,
      vowels="aeiouy",
      legal_frequency_threshold=0.001,
  ):
      """
      :param tokenized_source_text: List of valid tokens in the language
      :type tokenized_source_text: list(str)
      :param vowels: Valid vowels in language or IPA representation
      :type vowels: str
      :param legal_frequency_threshold: Lowest frequency of all onsets to be considered a legal onset
      :type legal_frequency_threshold: float
      """
      self.legal_frequency_threshold = legal_frequency_threshold
      self.vowels = vowels
      self.legal_onsets = self.find_legal_onsets(tokenized_source_text)
  
file_path: nltk/nltk/tokenize/legality_principle.py
imports: from collections import Counter
  from nltk.tokenize.api import TokenizerI
label_desc: Use image node_id 1 to create a new LegalitySyllableTokenizer object from inherited base classes: TokenizerI with example: obj = LegalitySyllableTokenizer(tokenized_source_text, vowels, legal_frequency_threshold)