How to use the prosodic.Corpus 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 / experiments / qclash.py View on Github external
from __future__ import division
import sys,clash,prosodic as p,rpyd2
p.config['print_to_screen']=0
c=p.Corpus(sys.argv[1])


def numclashes_aslist(ent,stressval=0.0):
	clashes=[]
	a=None
	for b in ent.syllables():
		if not a:
			a=b
			continue
		clashes+=[a.feature('prom.stress')==stressval and b.feature('prom.stress')==stressval]
		a=b
	return clashes

for t in c.texts():
	ld=[]
	dl_groups={}