NAME

huge-combine.pl

SYNOPSIS

Combines two bigram files created by count.pl into a single bigram file.

USGAE

huge-combine.pl [OPTIONS] COUNT1 COUNT2

INPUT

Required Arguments:

COUNT1 and COUNT2

combine-count.pl takes two bigram files created by count.pl as input. If COUNT1 and COUNT2 are of unequal sizes, it is strongly recommended that COUNT1 should be the smaller file and COUNT2 should be the lager bigram file.

Each line in files COUNT1, COUNT2 should be formatted as -

word1<>word2<>n11 n1p np1

where word1<>word2 is a bigram, n11 is the joint frequency score of this bigram, n1p is the number of bigrams in which word1 is the first word, while np1 is the number of bigrams having word2 as the second word.

Optional Arguments:

--help

Displays this message.

--version

Displays the version information.

OUTPUT

Output displays all bigrams that appear either in COUNT1 (inclusive) or in COUNT2 along with their updated scores. Scores are updated such that -

1:

If a bigram appears in both COUNT1 and COUNT2, their n11 scores are added.

e.g. If COUNT1 contains a bigram word1<>word2<>n11 n1p np1 and COUNT2 has a bigram word1<>word2<>m11 m1p mp1

Then, the new n11 score of bigram word1<>word2 is n11+m11

2:

If the two bigrams belonging to COUNT1 and COUNT2 share a commom first word, their n1p scores are added.

e.g. If COUNT1 contains a bigram word1<>word2<>n11 n1p np1 and if COUNT2 contains a bigram word1<>word3<>m11 m1p mp1

Then, the n1p marginal score of word1 is updated to n1p+m1p

3:

If the two bigrams belonging to COUNT1 and COUNT2 share a commom second word, their np1 scores are added.

e.g. If COUNT1 contains a bigram word1<>word2<>n11 n1p np1 and if COUNT2 contains a bigram word3<>word2<>m11 m1p mp1

Then, the np1 marginal score of word2 is updated to np1+mp1

AUTHOR

Amruta Purandare, Ted Pedersen. University of Minnesota at Duluth.

COPYRIGHT

Copyright (c) 2004,

Amruta Purandare, University of Minnesota, Duluth. pura0010@umn.edu

Ted Pedersen, University of Minnesota, Duluth. tpederse@umn.edu

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to

The Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.