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 8410301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:08:18+00:00 2026-06-10T00:08:18+00:00

I used lingpipe for sentence detection but I don’t have any idea if there

  • 0

I used lingpipe for sentence detection but I don’t have any idea if there is a better tool. As far as I have understood, there is no way to compare two sentences and see if they mean the same thing.

Is there anyother good source where I can have a pre-built method for comparing two sentences and see if they are similar?

My requirement is as below:

String sent1 = "Mary and Meera are my classmates.";

String sent2 = "Meera and Mary are my classmates.";

String sent3 = "I am in Meera and Mary's class.";

// several sentences will be formed and basically what I need to do is
// this

boolean bothAreEqual = compareOf(sent1, sent2);

sop(bothAreEqual); // should print true

boolean bothAreEqual = compareOf(sent2, sent3);

sop(bothAreEqual);// should print true
  • 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-06-10T00:08:19+00:00Added an answer on June 10, 2026 at 12:08 am

    How to test if the meaning of two sentences are the same: this would be a too open-ended question.

    However, there are methods for comparing two sentences and see if they are similar. There are many possible definition for similarity that can be tested with pre-built methods.

    See for example http://en.wikipedia.org/wiki/Levenshtein_distance

    Distance between 
    'Mary and Meera are my classmates.' 
    and 'Meera and Mary are my classmates.': 
    6
    Distance between 
    'Mary and Meera are my classmates.' 
    and 'Alice and Bobe are not my classmates.': 
    14
    Distance between 
    'Mary and Meera are my classmates.' 
    and 'Some totally different sentence.': 
    29
    

    code:

    public class LevenshteinDistance {
    
        private static int minimum(int a, int b, int c) {
            return Math.min(Math.min(a, b), c);
        }
    
        public static int computeDistance(CharSequence str1,
                CharSequence str2) {
    
            int[][] distance = new int[str1.length() + 1][str2.length() + 1];
    
            for (int i = 0; i <= str1.length(); i++){
                distance[i][0] = i;
            }
            for (int j = 0; j <= str2.length(); j++){
                distance[0][j] = j;
            }
            for (int i = 1; i <= str1.length(); i++){
                for (int j = 1; j <= str2.length(); j++){
                    distance[i][j] = minimum(
                        distance[i - 1][j] + 1,
                        distance[i][j - 1] + 1,
                        distance[i - 1][j - 1]
                            + ((str1.charAt(i - 1) == str2.charAt(j - 1)) ? 0 : 1));
                }
            }
            int result = distance[str1.length()][str2.length()];
            //log.debug("distance:"+result);
            return result;
        }
    
    
        public static void main(String[] args) {
            String sent1="Mary and Meera are my classmates.";
            String sent2="Meera and Mary are my classmates.";       
            String sent3="Alice and Bobe are not my classmates.";
            String sent4="Some totally different sentence.";
    
        System.out.println("Distance between \n'"+sent1+"' \nand '"+sent2+"': \n"+computeDistance(sent1, sent2));
        System.out.println("Distance between \n'"+sent1+"' \nand '"+sent3+"': \n"+computeDistance(sent1, sent3));
        System.out.println("Distance between \n'"+sent1+"' \nand '"+sent4+"': \n"+computeDistance(sent1, sent4));
    
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used MyRecorder sample by QTKit, it records everything but I have a problem
I've used LingPipe, Stanford's NER, RiTa and various sentence similarity libraries for my previous
I used zWeatherFeed to show weather, but I cant find any example to change
I used to have a code that checks any previous element with a corresponding
I used wsdltoobjc tool for create objective c class for EWS,but i got lot
Having used storyboards for a while now I have found them extremely useful however,
Used this tutorial I have installed jogl, jocl, gluegen, joal libs and added its
I used TiniFile to read a inf file . but in some section the
I used this coding to shorten my testimonials on my site, works perfectly!. But
This is a question only to those who already used the LingPipe. My question

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.