Ejemplo n.º 1
0
def wordPrep(totalVs, rSyls, cleanR, negroLista):
    blackList = 'mbits', 'vme', 'kant', 'fetch', 'fddi', 'theuth', 'helmholtz', 'trap', 'phi', 'cpu', 'judit', 'ieee', 'cm', 'mhz', 'km', 'mm', 'khz', 'oh', 'i', 'bcd', 'eh', 'hao', 'ghz', 'hz', 'bits', 'kbits', 'khces', 'mflops', 'mhces', 'gflops', 'ghces', 'marx', 'scsi', 'dma', 'gflop', 'mflop', 'traps', 'tick', 'checkpoints', 'ccitt', 'chist', 'kbit', 'mbit', 'sangley', 'mmu', 'risc', 'cisc'
    for all in blackList:
        negroLista.append(all)

    yaNoFound = []
    testLexi = []

    cons = gloFunk.globalOpen('cons', 'lista')
    emps = gloFunk.globalOpen('emps', 'lista')
    fono = gloFunk.globalOpen('fono', 'lista')
    testEDic = {}
    testFDic = {}

    for all in negroLista:
        try:
            masterLexi.remove(all)
        except ValueError:
            continue

    for all in masterLexi:
        if (len(emps[all]) >= rSyls) and (len(cons[all]) >= cleanR):            
            if (len(emps[all]) == totalVs):
                yaNoFound.insert(0, all)
                testLexi.append(all)
                testEDic[all] = emps[all]
                testFDic[all] = fono[all]
            else:
                yaNoFound.append(all)

    print('Lexicon=', len(yaNoFound), '\nTestLexi=', len(testLexi))

    return emps, fono, testEDic, testFDic, testLexi, yaNoFound
Ejemplo n.º 2
0
def chLexiPrep(masterLexi, negroLista, totalVs, rSyls, cleanR, tName, rName,
               cName):

    chList = []

    cons = gloFunk.globalOpen('cons', 'lista')
    emps = gloFunk.globalOpen('emps', 'lista')
    fono = gloFunk.globalOpen('fono', 'lista')

    for all in negroLista:
        try:
            masterLexi.remove(all)
        except ValueError:
            continue

    for all in masterLexi:
        if re.search('ch', all) and (len(emps[all]) >= rSyls) and (len(
                cons[all]) >= cleanR):
            chList.append(all)

    print('chList = ', len(chList))
    rhyFile = csv.reader(
        open("__global/__data/__rimas/completadas/cleand/rimaLib-t" + tName +
             "r" + rName + "c" + cName + ".csv",
             "r",
             encoding='latin-1'))
    rhyDic = {}
    for line in rhyFile:
        if len(line) != 0:
            rhyDic[line[0]] = str(line[1])

    return chList, rhyDic, fono, cons, emps
Ejemplo n.º 3
0
def chLexiPrep(masterLexi, negroLista, totalVs, rSyls, cleanR, tName, rName, cName):

    chList = []

    cons = gloFunk.globalOpen("cons", "lista")
    emps = gloFunk.globalOpen("emps", "lista")
    fono = gloFunk.globalOpen("fono", "lista")

    for all in negroLista:
        try:
            masterLexi.remove(all)
        except ValueError:
            continue

    for all in masterLexi:
        if re.search("ch", all) and (len(emps[all]) >= rSyls) and (len(cons[all]) >= cleanR):
            chList.append(all)

    print("chList = ", len(chList))
    rhyFile = csv.reader(
        open(
            "__global/__data/__rimas/completadas/cleand/rimaLib-t" + tName + "r" + rName + "c" + cName + ".csv",
            "r",
            encoding="latin-1",
        )
    )
    rhyDic = {}
    for line in rhyFile:
        if len(line) != 0:
            rhyDic[line[0]] = str(line[1])

    return chList, rhyDic, fono, cons, emps
Ejemplo n.º 4
0
                    )  # adds to dics if exists
                if each not in proxMinusLista[proxDicCounter][sentence[sentence.index(each) + proxNumerator]]:
                    proxMinusLista[proxDicCounter][sentence[sentence.index(each) + proxNumerator]].append(each)
        if len(proxPlusLista[proxDicCounter]) > 0:
            proxDicCounter += 1
            proxNumerator += 1
        else:
            while len(proxPlusLista) > proxDicCounter:
                proxPlusLista.remove(proxPlusLista[proxDicCounter])
                proxMinusLista.remove(proxMinusLista[proxDicCounter])
            break

print("proxDics complete\nstarting remix")


emps = gloFunk.globalOpen("emps", "lista")


def newLine():
    empKey = ["0", "1", "0", "0", "1", "0", "0", "1", "0"]
    pWEmps = ["2"]
    pLEmps = ["2"]
    while pLEmps != empKey:
        try:
            while (pWEmps != empKey[: len(pWEmps)]) and (len(pWEmps) > 0):
                xLine = str(random.choice(elTexto))
                pWord = random.choice(xLine.split(" "))
                try:
                    pWEmps = emps[pWord]
                except KeyError:
                    print("kError:", pWord)
Ejemplo n.º 5
0
#!/usr/local/bin/python3.2

import ftplib
from string import *
import csv
csv.field_size_limit(int(9999999))
import gloFunk

masterLexi = gloFunk.dirtyLexi('__txtBiblioteca/es-ES-opti.txt')
negroLista = gloFunk.dirtyLexi('__txtBiblioteca/negroList.txt')
fCons = 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'w', 'z'
listDefs = {}
superDic = gloFunk.globalOpen('superDic', 'string')

def fLiner(pWord, emps, fono, superDic, totalVs, rSyls, cleanR):
    superData = superDic[pWord].split('+')
    theseEmps = list(superData[0])
    theseFono = list(superData[2])

    vocsCt = int(0)
    consCt = int(0)
    fLine = str()
    pCt = len(theseFono)-1

    while ((consCt < cleanR) or (vocsCt < rSyls)) and (pCt>=0):
        if (theseFono[pCt] in fCons) and (consCt < cleanR):
            fLine = theseFono[pCt]+fLine
            consCt+=1
        elif (theseFono[pCt] not in fCons) and (vocsCt < rSyls):
            fLine = theseFono[pCt]+fLine
            vocsCt+=1
Ejemplo n.º 6
0
#!/usr/local/bin/python3.2

from string import *
import csv
csv.field_size_limit(int(9999999))
import re
import gloFunk

masterLexi = gloFunk.dirtyLexi('__txtBiblioteca/es-ES-opti.txt')
negroLista = gloFunk.dirtyLexi('__txtBiblioteca/negroList.txt')
blackList = 'mbits', 'vme', 'kant', 'fetch', 'fddi', 'theuth', 'helmholtz', 'trap', 'phi', 'cpu', 'judit', 'ieee', 'cm', 'mhz', 'km', 'mm', 'khz', 'oh', 'i', 'bcd', 'eh', 'hao', 'ghz', 'hz', 'bits', 'kbits', 'khces', 'mflops', 'mhces', 'gflops', 'ghces', 'marx', 'scsi', 'dma', 'gflop', 'mflop', 'traps', 'tick', 'checkpoints', 'ccitt', 'chist', 'kbit', 'mbit', 'sangley', 'mmu', 'risc', 'cisc'
for all in blackList:
    negroLista.append(all)
superDic = gloFunk.globalOpen('superDic', 'string')
fCons = 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'w', 'z'


def fLiner(pWord, emps, fono, superDic, totalVs, rSyls, cleanR):
    superData = superDic[pWord].split('+')
    theseEmps = list(superData[0])
    theseFono = list(superData[2])

    vocsCt = int(0)
    consCt = int(0)
    fLine = str()
    pCt = len(theseFono) - 1

    while ((consCt < cleanR) or (vocsCt < rSyls)) and (pCt >= 0):
        if (theseFono[pCt] in fCons) and (consCt < cleanR):
            fLine = theseFono[pCt] + fLine
            consCt += 1
Ejemplo n.º 7
0
    "mflop",
    "traps",
    "tick",
    "checkpoints",
    "ccitt",
    "chist",
    "kbit",
    "mbit",
    "sangley",
    "mmu",
    "risc",
    "cisc",
)
for all in blackList:
    negroLista.append(all)
superDic = gloFunk.globalOpen("superDic", "string")
fCons = "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "w", "z"


def fLiner(pWord, emps, fono, superDic, totalVs, rSyls, cleanR):
    superData = superDic[pWord].split("+")
    theseEmps = list(superData[0])
    theseFono = list(superData[2])

    vocsCt = int(0)
    consCt = int(0)
    fLine = str()
    pCt = len(theseFono) - 1

    while ((consCt < cleanR) or (vocsCt < rSyls)) and (pCt >= 0):
        if (theseFono[pCt] in fCons) and (consCt < cleanR):