Note that there are some explanatory texts on larger screens.

plurals
  1. PORegex that match different format sentences in c#
    primarykey
    data
    text
    <p>Format of file</p> <pre><code>POS ID PosScore NegScore SynsetTerms Gloss a 00001740 0.125 0 able#1" able to swim"; "she was able to program her computer"; a 00002098 0 0.75 unable#1 "unable to get to town without a car"; a 00002312 0 0 dorsal#2 abaxial#1 "the abaxial surface of a leaf is the underside or side facing away from the stem" a 00002843 0 0 basiscopic#1 facing or on the side toward the base a 00002956 0 0.23 abducting#1 abducent#1 especially of muscles; drawing away from the midline of the body or from an adjacent part a 00003131 0 0 adductive#1 adducting#1 adducent#1 especially of muscles; </code></pre> <p>In this file, I want to extract <strong>(ID,PosScore,NegScore and SynsetTerms)</strong> field. The <strong>(ID,PosScore,NegScore)</strong> field data extraction is easy and I use the following code for the data of these fields.</p> <pre><code>Regex expression = new Regex(@"(\t(\d+)|(\w+)\t)"); var results = expression.Matches(input); foreach (Match match in results) { Console.WriteLine(match); } Console.ReadLine(); </code></pre> <p>and it give the correct result but the Filed <strong>SynsetTerms</strong> create a problem because some lines have two or more words so how organize word and get against it PosScore And NegScore.</p> <p><strong>For example</strong>, in fifth line there are two words <code>abducting#1</code> and <code>abducent#1</code> but both have same score.</p> <p>So what will be regex for such line that get Word and its score, like:</p> <pre><code> Word PosScore NegScore abducting#1 0 0.23 abducent#1 0 0.23 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload