|
james aggeles wrote:Sorry for any inconvenience, but hopefully this will get someone out of a similar bind. Cheers!
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
james aggeles wrote:If there's no text, my program will print out that there was a 'word' that is blank, no space, just "", if you get the picture. But it counts it nevertheless, and I need it to not do that.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
james aggeles wrote:If there's no text, my program will print out that there was a 'word' that is blank, no space, just "", if you get the picture. But it counts it nevertheless, and I need it to not do that.
Well, I think you need to define first exactly what a "word" is, because you clearly have some restrictions. And I hate to say, but simply requiring them to be alphabetic isn't likely to work, because you'll have words like "shan't" and "cut-off" (not to mention "fo'c's'le") that don't comply.
Winston
james aggeles wrote:Thanks for the API link, but I don't see anything about intializing the ArrayList. I googled it but didn't see anyone creating an arraylist and then putting an array into it directly. do i have to create a for loop to do this with the .add command?
Wesleigh Pieters wrote:then you can just check if it contains and remove.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Joel Christophel wrote:For this, I've used the following in one of my programs, and it seems to work well...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Wesleigh Pieters wrote:thanks Winston, I would always like to learn better ways, I am fairly new to programming and Java.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Joel Christophel wrote:For this, I've used the following in one of my programs, and it seems to work well...
It also seems to be combining the functions of deciding what is a word, and what is inside quotation marks; and that's usually not a good idea.
Joel Christophel wrote:I agree with the procedural aspect, and that's easy to fix...
But the code, without getting overly in-depth, is defining when an apostrophe is not part of a word.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
I am not a mathematician, but my parser is definitely recursive. Since it is written in reversible FORTH, it is completely incomprehensible to the human eye.Winston Gutkowski wrote: . . . Parsing is a layered process - some of my mathematician colleagues here might even say a recursive one . . .
You can thank my dental hygienist for my untimely aliveness. So tiny:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|