Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/08/2011, 15:51
aleluy
 
Fecha de Ingreso: agosto-2011
Mensajes: 1
Antigüedad: 12 años, 8 meses
Puntos: 0
Pregunta ejercicios python

Hola a todos!!

No me gustaría abusar en exceso de vuestra amabilidad, pero estoy bastante apurada con unos ejercicios que necesito resolver, y, debido a mi escaso y torpe manejo con Python, me es imposible. Espero que alguien me pueda ayudar a dar con el código, se lo agradecería eternamente!!

Aquí van los ejercicios (siento que estén en inglés :S)

1. Define a function find_language() that takes a string as its argument, and returns a list of languages that have that string as a word. Use the udhr corpus and limit your searches to files in the Latin-1 encoding.
2. Obtain some raw text, in the form of a single, long string. Use Python's textwrap module to break it up into multiple lines. Now write code to add extra spaces between words, in order to justify the output. Each line must have the same width, and spaces must be approximately evenly distributed across each lines. No line can begin or end with a space.
3. Develop a simple extractive summarization tool, that prints the sentences of a document which contain the highest total word frequency. Use FreqDist() to count word frequencies, and use sum to sum the frequencies of the words in each sentence. Rank the sentences according to their score. Finally, print the n highest-scoring sentences in document order. Carefully review the design of your program, especially your approach to this double sorting. Make sure the program is written as clearly as possible.

Muchas gracias a todos!!!!