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

  • Home
  • SEARCH
  • 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 7946929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:17:10+00:00 2026-06-04T01:17:10+00:00

I have this pattern to get cause-effect relationship between noun phrases in a sentence:

  • 0

I have this pattern to get cause-effect relationship between noun phrases in a sentence:

<NP I> * have * effect/impact on/in <NP II>

NP is Noun Phrase.

If I have a sentence:

Technology can have negative impact on social interactions

then based on above pattern, NP I match with Technology and NP II match with social interactions

The question: what is appropriate algorithm to get NP I and NP II?

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-06-04T01:17:12+00:00Added an answer on June 4, 2026 at 1:17 am

    Regular expression (RegEx) is extremely useful in cases like this. The following regex matches your string format and allows for you to analyze the differing variables of the input.

    ([\\w\\s]*?) (\\w*?) have (\\w*?) (effect|impact) (on|in) ([\\w\\s]*?)(\\.)
    

    By running the following program, you can see how regex matcher groups work, and that group 1 is NP 1, and group 6 is NP 2.

    public class Regex {
    
        public static void main(String[] args) {
            Pattern p = Pattern.compile("([\\w\\s]*?) (\\w*?) have (\\w*?) (effect|impact) (on|in) ([\\w\\s]*?)(\\.)");
            String s = "Greenhouse gases can have negative impact on global warming.";
            Matcher m = p.matcher(s);
            if (m.find()) {
                for (int i = 0; i < m.groupCount(); i++) {
                    System.out.println("Group " + i + ": " + m.group(i));
                }
            }
        }
    }
    

    In the above example, the string "Greenhouse gases can have negative impact on global warming." is analyzed. The following is the output of the program.

    Group 0: Greenhouse gases can have negative impact on global warming.
    Group 1: Greenhouse gases
    Group 2: can
    Group 3: negative
    Group 4: impact
    Group 5: on
    Group 6: global warming
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this pattern: ~^([a-z0-9]+[a-z0-9-]+[a-z0-9]+\.([a-z]+)(\.[a-z]+)?)$~i It will match the following: xxx.xxx or xxx.xxx.xxx (number
I have this pattern written ^.*\.(?!jpg$|png$).+$ However there is a problem - this pattern
Ok so if I have this pattern: ab&bc&cd&de&ef And I need to replace all
I have this module pattern that stores a bunch of vars. I want to
I have got this regex pattern that works with my current apache log format:
I have this piece of code: function func1(text) { var pattern = /([\s\S]*?)(\<\?(?:attrib |if
So basically I have this giant regular expression pattern, and somewhere in the middle
I have a bunch of python methods that follow this pattern: def delete_session(guid): conn
In our code we have quite a few cases of this pattern: class outerClass
I have this pattern where I need to select any random element from a

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.