File: mys-parser.pl

package info (click to toggle)
yudit 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 18,472 kB
  • sloc: cpp: 76,344; perl: 5,630; makefile: 989; ansic: 823; sh: 441
file content (25 lines) | stat: -rwxr-xr-x 644 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl
# Print a map of characters from kmap.
# Gaspar Sinai <gaspar yudit org> 2020-05-17, Tokyo
$uniconv = "/home/gsinai/Test/bin/uniconv";
while (<>) {
    chop;
    $line=$_;    
    next unless (/(.*) -> (.*) #(.*)$/); 
    $input = $1;
    $chars = $2;
    $comment = $3;
    @ch = split (" ", $chars);
    foreach (@ch) {
      s/^[0]+//;
      printf ("U+%s ", $_);
    }
    $input =~ s/''/MAKKA/g;
    $input =~ s/'//g;
    $input =~ s/ //g;
    $input =~ s/MAKKA/'/g;
    $minput = $input;
    $minput =~ s/"/\\"/g;
    $output = `echo "$minput " | uniconv -decode OldHungarian`;
    print ("$comment ($input) $output");
}