Re: Case tagging and python
- From: bearophileHUGS@xxxxxxxxx
- Date: Thu, 31 Jul 2008 04:13:35 -0700 (PDT)
Fred Mangusta:
Could I use the join function to reform the string?
You can write a function to split the words, for example taking in
account the points too, etc.
And, regarding the casetest() function, what do you suggest to do?
Python strings have isupper, islower, istitle methods, they may be
enough for your purposes.
-open input file
-open output file
-get line of text
-split line into words
-for each word
-tag = checkCase(word)
-newword = lowercase(word) + append(tag)
rejoin words into line
write line into output file
It seems good. To join the words of a line there's str.join. Now you
can write a function that splits lines, and another to check the case,
then you can show them to us.
Yet, I don't see how much use can have your output file :-)
Bye,
bearophile
.
- Follow-Ups:
- Re: Case tagging and python
- From: Fred Mangusta
- Re: Case tagging and python
- References:
- Case tagging and python
- From: Fred Mangusta
- Case tagging and python
- Prev by Date: How smart is the Python interpreter?
- Next by Date: Re: Tkinter- Possibly a basic question
- Previous by thread: Case tagging and python
- Next by thread: Re: Case tagging and python
- Index(es):