How to use the prosodic.config.get 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 / MeterConstraint.py View on Github external
violated=False
				if ran and violated:
					return self.weight
				else:
					return 0

		elif self.name.lower().startswith('initialstrong'):
			#if meterPos.slots[0].i==0:
			if pos_i==0:
				if meterPos.meterVal == 's':
					return self.weight
			return 0

		elif self.name.lower().startswith('functiontow'):
			#exception for first foot
			if p.config.get('skip_initial_foot',0):
				if meterPos.slots[0].i<2:
					return 0

			if meterPos.meterVal != 's':	# then this constraint does not apply
				return 0

			vio = 0
			for slot in meterPos.slots:
				if slot.word.feature('functionword'):
					vio += self.weight
			return vio

		elif self.name.lower().startswith('footmin'):
			if len(meterPos.slots) < 2:
				return 0
			elif len(meterPos.slots) > 2:
github quadrismegistus / prosodic / prosodic / lib / Word.py View on Github external
def __str__stressedSylls(self):
		lang=self.lang
		import prosodic
		if (not 'output_'+lang in prosodic.config):
			lang="**"
		if prosodic.config.get('output_'+lang,'')=="cmu":
			return " . ".join([str(syll) for syll in self.children])
		else:
			return ".".join([str(syll) for syll in self.children])