04-28-2009
This sounds like homework, but since you have actually posted some working code, I'll give you the benefit of the doubt.
You must concatenate s until you find an end-of-sentence delimiter. An end-of-sentence delimiter should look like one of: ". ", "! ", "? ". So first, you do a find for each of these strings, and if not sound, you concatenate the entire line to s. When you do find one, you split the line, concatenating the first part to s, and leaving the remainder for the next sentence (new variable). Then you search s for your target string. Then you replace s with the remainder of the sentence, and continue your loop.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi guys,i got this problem which is..i need to find those sentences with date inside and extract them out,the input is somehow like this
eg:
$DATA42.GANTRY2.GA161147 DISKFILE 2007-10-16 11:56:45 SUPER.OPR \NETS.$Y4CB.#IN
... (4 Replies)
Discussion started by: cyberray
4 Replies
2. Shell Programming and Scripting
Just wondering if there's a better way to get these complete sentences into an array and keep the quotes intact? All the quotes make it look ugly to me but it works. I want to be able to refer to the full sentences by index. I've tried a few qw and qq/ aproaches but what I have below seems about... (4 Replies)
Discussion started by: gctaylor
4 Replies
3. Shell Programming and Scripting
FOLKS ,
i have a text file that is generated automatically of an another korn shell script, i want to bring in the fifth line of the text file in to my korn shell script and look for a particular word in the line . Can you all share some thoughts on this one.
thanks...
Venu (3 Replies)
Discussion started by: venu
3 Replies
4. UNIX for Dummies Questions & Answers
Hi guys
Need your help how do I extract sentences with only a word
i.e.
today is hot
hot
very
humid
humid2
Sample output
hot
very (0 Replies)
Discussion started by: jamestan
0 Replies
5. Shell Programming and Scripting
Hi guys
Need your help how do I extract sentences with only a word
i.e.
today is hot
hot
very
humid
humid2
Sample output
hot (6 Replies)
Discussion started by: jamestan
6 Replies
6. Shell Programming and Scripting
Hi i want to extract the word present before .txt in the text file.
For example,
Sample_ab_a.txt ----------> i need 'a'
Sample_abc_b.txt -----------> i need 'b'
Can anyone help me in getting the word extracted (5 Replies)
Discussion started by: Sindhuap
5 Replies
7. Shell Programming and Scripting
Hello, I need some help extracting the number after the RBA e.g 15911688 from the below block of text (e.g: grep RBA |sed .......). The code should be valid for blocks if text generated at different times as well and not for the below text only.
... (2 Replies)
Discussion started by: drbiloukos
2 Replies
8. Shell Programming and Scripting
Hi
I have two lists of patterns named A and B consisting of around 200 entries in each and I want to extract all the sentences from a big text file which match atleast one pattern from both A and B.
For example, pattern list A consists of :
ama
ani
ahum
mari
...
...
and pattern... (1 Reply)
Discussion started by: my_Perl
1 Replies
9. Shell Programming and Scripting
Hi
I have a big text file. I want to extract all the sentences that matches at least 70% (seventy percent) of the words from each sentence based on a word list called A.
Say the format of the text file is as given below:
This is the first sentence which consists of fifteen words... (4 Replies)
Discussion started by: my_Perl
4 Replies
10. Shell Programming and Scripting
Hi
I have two text files. The first file is TEXTFILEONE.txt as given below:
<Text Text_ID="10155645315851111_10155645333076543" From="460350337461111" Created="2011-03-16T17:05:37+0000" use_count="123">This is the first text</Text>
<Text Text_ID="10155645315851111_10155645317023456"... (7 Replies)
Discussion started by: my_Perl
7 Replies
style(1) General Commands Manual style(1)
NAME
style - Analyzes surface characteristics of a document.
SYNOPSIS
style [-ml] [-mm] [-a] [-e] [-l num] [-r num] [-p] [-P] file...
OPTIONS
Displays all sentences with their length and readability index. Displays all sentences that begin with an expletive. Displays all sen-
tences longer than num. Skips lists in the document. Overrides the default -ms macro package. Displays parts of speech of the words in
the document. Displays all sentences that contain a passive verb. Displays all sentences whose readability index is greater than num.
DESCRIPTION
The style command analyzes the surface characteristics of the writing style of a document. It reports on readability, sentence length and
structure, word length and usage, verb type, and sentence openers. Because style runs deroff before looking at the text, formatting header
files should be included as part of the input. The default macro package -ms may be overridden with the -mm option. The -ml option, which
causes deroff to skip lists, should be used if the document contains many lists that contain non-sentences. Use the other options to locate
sentences with certain characteristics.
RESTRICTIONS
Use of non-standard formatting macros may cause incorrect sentence breaks.
SEE ALSO
Commands: deroff(1), diction(1)
style(1)