# HG changeset patch # User Matti Hamalainen # Date 1451513135 -7200 # Node ID 74e0675300de6add235d04ae32f3865662566592 # Parent 1f3fd2d0831bfe7bb4ea636d4916a4c359f88a2c Remove useless utility, the functionality has been integrated into parsematerial.pl diff -r 1f3fd2d0831b -r 74e0675300de materials/csv2transtab.pl --- a/materials/csv2transtab.pl Wed Dec 30 23:17:46 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -#!/usr/bin/perl -w -# -# Generate translation table from CSV format material data -# Developed by Matti Hämäläinen (Ggr Pupunen) -# (C) Copyright 2006-2010 Tecnic Software productions (TNSP) -# -# The generated table needs to be manually sorted in "sane" way, -# the different adjectives cannot be heuristically sorted here. -# -use strict; - -my %data = (); - -while () { - chomp; - if (my @tmp = /^([a-z ]+);([a-z ]+);([a-z ]+);([a-z ]+);([a-z ]+);([a-z ]+);([a-z ]+);([a-z ]+);([a-z ]+);([a-z ]+);([a-z ]+);([a-z ]+);([a-z ]+);([a-z -]+);([a-z ]+);([a-zA-Z ]+);(Yes|No);([A-Z][a-z]+);([a-z, ]+);([a-z, ]+);$/) { - my $n = 2; - for (my $i = 1; $i <= 17; $i++, $n++) { - $data{$n}{$tmp[$i]}=1; - } - for (my $i = 18; $i <= 19; $i++, $n++) { - foreach my $t (split(/, */, $tmp[$i])) { - $data{$n}{$t} = 1; - } - } - } else { - print STDERR "$0: ERROR: $_\n"; - } -} - -print "my %matTransTable = (\n"; - -foreach my $a (sort { $a <=> $b } keys %data) { - print " $a => {\n"; - my $i = 0; - foreach my $b (keys %{$data{$a}}) { - print " \"$b\" => $i,\n"; - $i++; - } - print " },\n"; -} -print ");\n";