Closed

Java help matching multiple words

Need some help with Java. I'm trying to match multiple words in a string and can't figure out how to use more than word at a time instead of checking 1 word at a time. I would like the condition to only be true if all keywords are found in the sentence. Example: Search sentence for both "Astronaut" and "Moon" and return true only if both are found in sentence.

The code is incomplete. But strings with a + character need to be considered as 2 keywords to search for before moving on to the next in the array if no match found.

Here's a bit of my code:

String sentence = "The Astronaut landed on the moon using the Apollo 13 space shuttle.";

String[] keywords = {"Astronaut+Moon", "Moon+Apollo", "Apollo+shuttle"};

int size = [url removed, login to view];

for (int i=0; i<size; i++)

{

Pattern p = [url removed, login to view](keywords[i] + ".*");

Matcher m = [url removed, login to view](sentence);

if ([url removed, login to view]()){[url removed, login to view]("Match Found");}

}

Skills: Java, Programming, Software Architecture

See more: software write mq4, software write chip epson, useful software write book, software write web specs, free software write user guide, software write edid, free software write company profile, software write websites idea, software write book images, software write books, software write protection, free software write book, adding multiple items vector java, software write book, multiple upload flash java, java array game programs, need help java assignments, help java exercises, java array card game, zen cart shipping multiple items help, java array mortgage calculator, multiple image upload java, free help java assingments, help java assignments, help java project chat

About the Employer:
( 2 reviews ) Memphis, United States

Project ID: #11929099

43 freelancers are bidding on average $66 for this job

vano101

Hello. Can you send your code? Thanks.

$51 USD in 2 days
(1085 Reviews)
7.2
dobreiiita

Hello I am Java expert and interested in this project. I have reviewed the details and confident to handle it perfectly. I have a lot of experience in helping in students with assignments, so I will keep cod More

$50 USD in 1 day
(392 Reviews)
7.3
AhmedLabib93

Hello My name is Ahmed, i'm a top rated freelancer. i worked over 250 projects and over 600 hours doing java projects. plus i passed freelancer java exam with top 15% plus i got 2 java certificate 1Z0-803 and 1Z0- More

$30 USD in 1 day
(269 Reviews)
6.2
Calleus

Hi, I have strong background in JAVA and experience in Algorithms. Let me help you. I am ready to start.

$70 USD in 3 days
(95 Reviews)
6.1
ahmsak

Hello Sir, I have already done it and completed it. I am a computer science tutor, I teach (among others) Automata, Regex and Algorithms. I have done many projects like this, and I'm one of the top Algorithms develo More

$40 USD in 3 days
(57 Reviews)
5.7
$100 USD in 3 days
(19 Reviews)
5.2
vorasiddh4it

Hello, You can see my last project which are based on Machine Learning and I can complete your project perfectly. We have 9+ years experience in Java software development. We have successfully developed 400+ proj More

$150 USD in 3 days
(20 Reviews)
5.0
tumakha

I am Senior Java/Scala Developer with 15 years of experience in design and development with strong problem solving skills. Code Samples [url removed, login to view] CV [url removed, login to view]

$111 USD in 2 days
(13 Reviews)
4.7
usmanshery

Hi i'm software engineer and expert java developer with experience in many technologies regarding java. I have red your description i can help you with this kind of stuff. Please contact me and discus details Regards More

$50 USD in 1 day
(36 Reviews)
5.0
achouriissam

Hello, My name is Achouri Issam. I have over two years experience in Software Engineering and i have a good Knowledge with Java, JavaEE,Android,IOS, Spring, Spring MVC, EJB,Struts2, Hibernate, JSP, Servlet , JPA, More

$60 USD in 2 days
(9 Reviews)
4.6
shahidost

Hi, I hope you will be doing well. I believe on perfect work with 100% satisfaction of my client then payment. I deliver only exceptionally robust and well-designed work as a rule to my client. I understand your More

$100 USD in 2 days
(34 Reviews)
4.7
Shchipunov

Hello, I will send the solution after you award me the project. Before I get paid I will provide a proof to guarantee that it works correctly. Thanks.

$30 USD in 1 day
(21 Reviews)
4.3
yakubpune

WISHING YOU PEACE IN YOUR LIFE. Can be done without for loop search !!!!. I have more than 8 years of experience in JAVA. The breakup of experience as per best of my knowledge: Hibernate 3.x - 4.x : 2 years 4 mont More

$125 USD in 1 day
(9 Reviews)
4.3
$155 USD in 3 days
(21 Reviews)
4.5
JinTaiZhe

Thank you for reviewing my profile. I am a professional programmer who likes to make games and apps in any and all technologies. With 7 years experience in coding and programming, I'm familiar with - iPhone games (C More

$150 USD in 3 days
(11 Reviews)
4.3
NaveenNishaan

A proposal has not yet been provided

$50 USD in 1 day
(17 Reviews)
4.2
proo4

hi, am here to help you dear ..............................................................................

$35 USD in 1 day
(15 Reviews)
4.6
$30 USD in 3 days
(3 Reviews)
3.7
rajdeepa555

Hello Sir, I have 6 years of experience in J2EE,c#,C, php, python based technologies. Regarding front end technologies, I am proficient in html, java script, jquery. My recent java works are as follows - I'm More

$50 USD in 1 day
(5 Reviews)
3.6
SabidHabib

hello sir, I am expert in java and I have done similar task in past. Let's discuss in detail about your project.

$120 USD in 0 days
(20 Reviews)
3.3