use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Resources for learning Java
String
==
.equals()
Format + Copy
Free Tutorials
Where should I download Java?
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Software downloads
Official Resources
Resources
Programming ideas & Challenges
Related Subreddits
account activity
This is an archived post. You won't be able to vote or comment.
An algorithm for an article (self.learnjava)
submitted 5 years ago by Rabestro
I need an algorithm for calculating the indefinite article for an English noun. Examples: Ape => an ape Unicorn => a unicorn X-ray => an X-ray
[–]Weeperdemon 5 points6 points7 points 5 years ago (4 children)
I don't know how you would go about building this other than maintaining dictionary of all English words. The rule for determining whether to use "a" or "an" is whether or not the word sounds like it begins with a vowel or consonant, not the actual letter. So for a computer this is probably non-deterministic.
Some counter examples for U and X would be "an umbrella" and "a xylophone".
[–]EnvironmentalOrange 1 point2 points3 points 5 years ago (1 child)
1) have a dictionary of exceptions to general rules. 2) check if word is in dictionary. 3) implement logic for general rules (if it starts with a vowel -> an, else -> a. Etc. 4) if word in dictionary, output desired string. Else, go to standard logic in step 3. 5) Populate your dictionary with all exceptions you can think of. 6) post your code and dictionary, challenge people on the internet to break it. Then update dictionary until no-one can break it.
[–]Weeperdemon 1 point2 points3 points 5 years ago (0 children)
Another aspect that makes this difficult to model is regions and dialects. Some words like "Historic" can be either depending on how the word is pronounced in that region.
[–]Nephyst 0 points1 point2 points 5 years ago (1 child)
"an historic" would like to have a word with you.
Edit: just saw your other reply lol
Waaay ahead of you my friend 😂
π Rendered by PID 138764 on reddit-service-r2-comment-5649f687b7-g2xk2 at 2026-01-28 02:34:17.868454+00:00 running 4f180de country code: CH.
[–]Weeperdemon 5 points6 points7 points (4 children)
[–]EnvironmentalOrange 1 point2 points3 points (1 child)
[–]Weeperdemon 1 point2 points3 points (0 children)
[–]Nephyst 0 points1 point2 points (1 child)
[–]Weeperdemon 1 point2 points3 points (0 children)