User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

public:paste:compile_dicts.pl [2014-07-10 20:14] – created Johannes Graënpublic:paste:compile_dicts.pl [2023-09-15 20:33] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +<file perl>
 +#!/usr/bin/perl
  
 +use strict;
 +use warnings;
 +
 +my %languages = (
 +        0 => 1550,
 +        1 => 1834,
 +        2 => 5996,
 +        3 => 1948,
 +        4 => 2645,
 +);
 +
 +foreach my $i (keys %languages) {
 +        foreach my $j (keys %languages) {
 +                next if $j <= $i;
 +                my $c = sprintf 'sed -r -e "s/%%1/%d/" -e "s/%%2/%d/" < dicts.sql '
 +                        .'| psql --host kitt.ifi.uzh.ch --user laacuser laac -t -A '
 +                        .'> dicts/%3$d_%4$d.dict 2> %3$d_%4$d.err',
 +                        $languages{$i}, $languages{$j}, $i, $j;
 +                print "$c\n";
 +                system $c;
 +        }
 +}
 +</file>

CL Wiki

Institute of Computational Linguistics – University of Zurich