Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6769447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:11:41+00:00 2026-05-26T15:11:41+00:00

I need to do the intelligence Sentence comparison in Objective C. The Detail’s are

  • 0

I need to do the intelligence Sentence comparison in Objective C.

The Detail’s are explained below.

I have one main string. I named it as “OriginalString”

                   NSString *OriginalString = @""HOW DID STUDENT EMILY DO TODAY";

Then I have many strings, that i need to compare with the Original String.They are

             NSString *CompareString1 = @"HOW DID EMILY DO "
             NSString *CompareSting  = @"HOW DID YOUR FATHER"
             NSString *CompareString2 = @"WHAT IS YOUR EMILY"
             NSString *CompareString3 = @"THIS IS THE FAST DO ONE"
             NSString *CompareString4 = @"THIS SEARCH EMILY EXAMPLE DO"

From these 5 CompareStrings ,i need to get the string “HOW DID EMILY DO” which is highest relative to the Original string(HOW DID STUDENT EMILY DO TODAY) .

Let me tell you one thing.

If i have an additional string in the group of CompareStrings As “HOW DID STUDENT DO TODAY”

So now i have the CompareStrings are

             NSString *CompareString1 = @"HOW DID EMILY DO "
             NSString *CompareSting  = @"HOW DID YOUR FATHER"
             NSString *CompareString2 = @"WHAT IS YOUR EMILY"
             NSString *CompareString3 = @"THIS IS THE FAST DO ONE"
             NSString *CompareString4 = @"THIS SEARCH EMILY EXAMPLE DO"
             NSString *CompareString4 = @"HOW DID STUDENT DO TODAY"

From these 6 CompareStrings ,i need to get the string “HOW DID STUDENT DO TODAY” which is highest relative to the Original string (HOW DID STUDENT EMILY DO TODAY)

I have looked the NSPredicate “comparison and like” methods. However i didn’t found any way to do the process

Any help on figuring out this concept is appreciated.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:11:41+00:00Added an answer on May 26, 2026 at 3:11 pm

    Sounds like comp-sci homework. It’s sloppy and inefficient as hell, but it will work. I’m sure somebody on here has a better idea to improve performance.

    Break down your phrases that you want to search for into arrays of individual words:

    NSArray *myWords = [myString componentsSeparatedByString:@" "];
    

    Now myWords is an array of each word (no spaces). Then, build a predicate looking for each of the words:

    int found = 0;
    for (NSString* word in myWords) {
        NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF like[c] %@", word];
        BOOL ok = [predicate evaluateWithObject:originalString];
        if (ok) {
          ++found;
        }
    }
    

    When you are done, you’ll end up with a found you can compare for each of the different phrases. The one that is greatest matched the most words.

    In this case, you’d end up counting like this:

    HOW DID STUDENT EMILY DO TODAY

    • “HOW DID EMILY DO ” 4
    • “HOW DID YOUR FATHER” 2
    • “WHAT IS YOUR EMILY” 1
    • “THIS IS THE FAST DO ONE” 1
    • “THIS SEARCH EMILY EXAMPLE DO” 2
    • “HOW DID STUDENT DO TODAY” 5
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making some small business intelligence applications/tools that need to talk to other
need ask you about some help. I have web app running in Net 2.0.
Need some help about with Memcache. I have created a class and want to
Whenever I need to use the intelligence of Netbeans to show properties/methods, I explicitly
We have an architecture where we provide each customer Business Intelligence-like services for their
I need to have a function in C++/CLI which do the link between a
I want to write some code that need to use artificial intelligence. I dont
I am a BusinessObjects Desktop Intelligence (XIR2) report developer and there is a need
I need very basic help (hopefully) on an Artificial Intelligence Project. My question is
So, I have a grad class on artificial intelligence and our final project was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.