How to use the prosodic.lib.Word.Word function in prosodic

To help you get started, we’ve selected a few prosodic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github quadrismegistus / prosodic / prosodic / lib / Word.py View on Github external
from Dictionary import stressedipa2stress,getStrengthStress
		from Syllable import Syllable

		stress=stressedipa2stress(stressedipa)
		(prom_stress,prom_strength)=getStrengthStress(stress)

		syllphons=[tuple(child.phonemes()) for child in self.children]
		syllbodies = self.syllableBodies()

		sylls=[]
		for i in range(len(syllphons)):
			syllbody=syllbodies[i]
			syll=Syllable((syllbody,prom_strength[i],prom_stress[i]),lang=self.lang,token=self.sylls_text[i])
			sylls.append(syll)

		word=Word(self.token,sylls,self.sylls_text)
		word.ipa=stressedipa
		word.stress=stress
		word.lang=self.lang

		# when is word broken?
		if not word.ipa:
			word.broken=True

		return word