How to match all array contents and display all highest matched sentences in perl?
Hi,
I have an array with 3 words in it and i have to match all the array contents and display the exact matched sentence i.e all 3 words should match with the sentence.
Here are sentences.
I want all there 3 words to be matched and that sentence has to printed first.
Here are the words. I tried like this:
Just stuck up here!!
The output should be like this:
How can i match all these words and print the sentence with highest match (all the words matching the sentence) in perl??
Hi,
I have sentences like this:
$sent=
Protein modeling studies reveal that the RG-rich region is part of a three to four strand antiparallel beta-sheet, which in other RNA binding protein functions as a platform for nucleic acid interactions.
Heterogeneous nuclear ribonucleoparticle... (19 Replies)
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)
Hi i have just registered
So i am at university studying forensic computing and we have to learn c++
i have never done anything with c++ before and i am abit stuck
i need to create a programme to display the contents of an array of characters forwards and in reverse
Can anyone help me... (1 Reply)
Basically to illuminate i want to take a file with mutliple lines,
C:\searching4theseletters.txt
a
b
c
Read this into an array
@ARRAY
and then use this to compare against another file
C:\inputletters.txt
b
o
a
c
n
a (9 Replies)
I'm currently working with dozens of FASTA files, and I'm tired of having to manually change the filename in my Perl script.
I'm trying to write a simple Perl script that'll create a 2-dimensional array containing the name of the folders and its contents.
For example, I would like the output... (6 Replies)
Hi there
I have a counter called
my $counter = 0;
I am trying to build an array that will have a name that is for example
my @array0 = ("some", "stuff");
but instead of hard coding the "0" in the array name i want to use whatever value the aforementioned $counter has in it...so
... (1 Reply)
Hi ,
I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code.
my $current_value=12345;
my @users=("bob","ben","tom","harry");
open DBLIST,"<","/var/tmp/DBinfo";
my @input = <DBLIST>;
foreach (@users)
{
my... (11 Replies)
ksh
eg
arrayname=(1 2 3 4 5)
I'm trying to display the individual contents of an array on a new line without using a loop, using one line of code.
output
1
2
3
4
5 (3 Replies)
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
LEARN ABOUT DEBIAN
text::greeking
Text::Greeking(3pm) User Contributed Perl Documentation Text::Greeking(3pm)NAME
Text::Greeking - a module for generating meaningless text that creates the illusion of the finished document.
SYNOPSIS
#!/usr/bin/perl -w
use strict;
use Text::Greeking;
my $g = Text::Greeking->new;
$g->paragraphs(1,2) # min of 1 paragraph and a max of 2
$g->sentences(2,5) # min of 2 sentences per paragraph and a max of 5
$g->words(8,16) # min of 8 words per sentence and a max of 16
print $g->generate; # use default Lorem Ipsum source
DESCRIPTION
Greeking is the use of random letters or marks to show the overall appearance of a printed page without showing the actual text. Greeking
is used to make it easy to judge the overall appearance of a document without being distracted by the meaning of the text.
This is a module is for quickly generating varying meaningless text from any source to create this illusion of the content in systems.
This module was created to quickly give developers simulated content to fill systems with simulated content. Instead of static Lorem Ipsum
text, by using randomly generated text and optionally varying word sources, repetitive and monotonous patterns that do not represent real
system usage is avoided.
METHODS
Text::Greeking->new
Constructor method. Returns a new instance of the class.
$g->init
Initializes object with defaults. Called by the constructor. Broken out for easy overloading to enable customized defaults and other
behaviour.
$g->sources([@ARRAY])
Gets/sets the table of source word collections current in memory as an ARRAY reference
$g->add_source($text)
The class takes a body of text passed as a SCALAR and processes it into a list of word tokens for use in generating random filler text
later.
$g->generate
Returns a body of random text generated from a randomly selected source using the minimum and maximum values set by paragraphs,
sentences, and words minimum and maximum values. If generate is called without any sources a standard Lorem Ipsum block is used added
to the sources and then used for processing the random text.
$g->paragraphs($min,$max)
Sets the minimum and maximum number of paragraphs to generate. Default is a minimum of 2 and a maximum of 8.
$g->sentences($min,$max)
Sets the minimum and maximum number of sentences to generate per paragraph. Default is a minimum of 2 and a maximum of 8.
$g->words($min,$max)
Sets the minimum and maximum number of words to generate per sentence. Default is a minimum of 5 and a maximum of 15.
SEE ALSO
http://en.wikipedia.org/wiki/Greeking
TO DO
HTML output mode including random hyperlinked phrases.
Configurable punctuation controls.
PARTICIPATION
I welcome and accept patches in diff format. If you wish to hack on this code, please fork the git repository found at:
<http://github.com/tima/perl-text-greeking/>. If you have something to push back to my repository, just use the "pull request" button on
the github site.
LICENSE
The software is released under the Artistic License. The terms of the Artistic License are described at
<http://www.perl.com/language/misc/Artistic.html>.
AUTHOR & COPYRIGHT
Except where otherwise noted, Text::Greeking is Copyright 2005-2009, Timothy Appnel, tima@cpan.org. All rights reserved.
perl v5.10.0 2009-08-28 Text::Greeking(3pm)