in reply to Nested Cycle - Statistic measure

Excuse me for my mis-understanding. Can you clarify? What is special about "kill-v"?
#!/usr/bin/perl -w use strict; use Data::Dumper; use Data::Dump qw (pp); my %animals; my %verbs; # Your say, "In the example above, the only feat that occurs # both with beast and frog is kill-v". # # I don't see it # Obviously there is something that I don't understand... # # this simple code gets multiple things in common # I don't understand how to filter out "see-v" and "turn-v" # Prints: # turn-v: beast-n frog-n # see-v: beast-n frog-n # kill-v: beast-n frog-n while (<DATA>) { my ($animal, $verb) = (split(' ', $_))[1,3]; $animals{$animal}++; push @{$verbs{$verb}}, $animal; } foreach my $verb (keys %verbs) { if (@{$verbs{$verb}} > 1) { print "$verb: @{$verbs{$verb}}", "\n"; } } __DATA__ 1 beast-n into transform-v 356.9551 2 beast-n obj kill-v 266.2511 3 beast-n obj see-v 252.3623 4 beast-n prd become-v 250.9534 5 beast-n obj tame-v 224.6948 6 beast-n into turn-v 191.9883 7 beast-n obj call-v 171.4000 8 beast-n sbj_intr devour-v 165.3228 9 beast-n obj hunt-v 155.7637 10 beast-n obj fight-v 150.4370 11 beast-n obj slay-v 150.3982 1 frog-n obj find-v 322.5589 2 frog-n into turn-v 307.3012 3 frog-n sbj_intr jump-v 235.0503 4 frog-n coord-1 toad-n 207.3611 5 frog-n obj see-v 207.2610 6 frog-n obj eat-v 204.1762 7 frog-n obj kill-v 64.6689

Replies are listed 'Best First'.
Re^2: Nested Cycle - Statistic measure
by remluvr (Sexton) on Mar 12, 2012 at 20:29 UTC

    Kill-v is the only feature that occur both with beast-n and frog-n. I have been given two words, (frog-n and beast-n, for example) and I have to take care only of features that occur with both of the words I have.
    I hope this clarify it a little
    Thanks again Giulia

      Kill-v is the only feature that occur both with beast-n and frog-n.

      Sorry, no. I can see that's not right even by eye-balling your data.

      And Marshall's code above (did you actually bother to run it?) proves that your claim is wrong!

      What haven't you told us about turn-v and see-v ??

        Sorry. I was wrong reading my data. You are both right. So, I even need turn-v and see-v, because these too are feature that occur with both names.
        Sorry again, my bad.