PERL   126
one-line
Guest on 25th August 2022 01:52:45 PM


  1. #!/usr/local/bin/perl
  2.  
  3. #
  4. #  one-line
  5. #    This program will extract parts of speech
  6. #    in BNC format and put them individually on one line
  7. #
  8. #    Alex Krotov <alexk@dcs.shef.ac.uk>
  9.  
  10. while(<>)
  11. {
  12.  
  13.    chop;
  14.    #print $_, "\n";
  15.  
  16.    #if (/\<s/)
  17.    #{
  18.    #   print "---\n";
  19.    #   next;
  20.    #}
  21.    
  22.    while (s/(\<w \w+\>[^\<]+)//)
  23.    {
  24.      print $1, "\n";
  25.    }
  26.  
  27. }

Raw Paste

Login or Register to edit or fork this paste. It's free.