Foros del Web » Programando para Internet » Python »

Ayuda con ejercicios (inglés)

Estas en el tema de Ayuda con ejercicios (inglés) en el foro de Python en Foros del Web. Hola!! alguien me puede decir como hacer estos dos ejercicios?? ◑ Read in some text from a corpus, tokenize it, and print the list of ...
  #1 (permalink)  
Antiguo 17/05/2009, 01:38
w2a
 
Fecha de Ingreso: mayo-2009
Mensajes: 1
Antigüedad: 14 años, 11 meses
Puntos: 0
De acuerdo Ayuda con ejercicios (inglés)

Hola!! alguien me puede decir como hacer estos dos ejercicios??

◑ Read in some text from a corpus, tokenize it, and print the list of all wh-word types that occur. (wh-words in English are used in questions, relative clauses and exclamations: who, which, what, and so on.) Print them in order. Are any words duplicated in this list, because of the presence of case distinctions or punctuation?

◑ Create a file consisting of words and (made up) frequencies, where each line consists of a word, the space character, and a positive integer, e.g. fuzzy 53. Read the file into a Python list using open(filename).readlines(). Next, break each line into its two fields using split(), and convert the number into an integer using int(). The result should be a list of the form: [['fuzzy', 53], ...].
  #2 (permalink)  
Antiguo 20/05/2009, 22:28
AlvaroG
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: Ayuda con ejercicios (inglés)

¿Necesitás ayuda en traducir la letra del problema, o en hacer el ejercicio?

Si es con la letra, simplemente pídele a translate.google.com que te de una mano

Si es con cómo hacer el ejercicio, aquí te van algunas sugerencias:
Para el primero: split() y luego un for combinado con el operador in (teniendo una lista o tupla con las palabras que querés encontrar).

El segundo es aún más sencillo, en la letra misma te dice cómo hacerlo.


Saludos.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:10.