Python library to break text into words

Chris Angelico rosuav at gmail.com
Thu May 31 17:42:31 EDT 2018


On Fri, Jun 1, 2018 at 7:09 AM, Dietmar Schwertberger
<maillist at schwertberger.de> wrote:
> On 5/31/2018 10:26 PM, beliavsky--- via Python-list wrote:
>>
>> Is there a Python library that uses intelligent guesses to break sequences
>> of characters into words? The general strategy would be to break strings
>> into the longest words possible. The library would need to "know" a sizable
>> subset of words in English.
>
>
> No need to re-invent the wheel:
>
> import webbrowswer
> webbrowser.open(
> "https://www.google.com/search?q=%s"%"atomicaccidents.pdf"+"+amazon", new=0)
>
>
> Copy the title from the browser window and paste it into your script's
> window which will read it with input() and rename the file.

10/10 for grin-worthy solutions :)

ChrisA



More information about the Python-list mailing list