From 5d1ce5c1a4cc1c9cc4091847c19552394155a92a Mon Sep 17 00:00:00 2001 From: redpony Date: Wed, 18 Aug 2010 22:20:32 +0000 Subject: add example grammar git-svn-id: https://ws10smt.googlecode.com/svn/trunk@594 ec762483-ff6d-05da-a07a-a48fb63a330f --- report/pyp_clustering/format-grammar-latex.pl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 report/pyp_clustering/format-grammar-latex.pl (limited to 'report/pyp_clustering') diff --git a/report/pyp_clustering/format-grammar-latex.pl b/report/pyp_clustering/format-grammar-latex.pl new file mode 100755 index 00000000..e1fe3e45 --- /dev/null +++ b/report/pyp_clustering/format-grammar-latex.pl @@ -0,0 +1,21 @@ +#!/usr/bin/perl -w +use strict; +my $x = ''; +while(<>){ + if (/^$/) { print "\\hline\n"; next; } + if (/^(\d+)$/) { + $x=$1; + $x=~s/^(\d\d\d)(\d\d\d)(\d\d\d)$/$1,$2,$3/; + $x=~s/^(\d\d)(\d\d\d)(\d\d\d)$/$1,$2,$3/; + $x=~s/^(\d)(\d\d\d)(\d\d\d)$/$1,$2,$3/; + $x=~s/^(\d\d\d)(\d\d\d)$/$1,$2/; + $x=~s/^(\d\d)(\d\d\d)$/$1,$2/; + $x=~s/^(\d)(\d\d\d)$/$1,$2/; + next; + } + s/ \|\|\| LHSProb.*$//; s/ \|\|\| / \\rightarrow \\langle \\textrm{/; s/\[X(\d+)\]/\\textrm{X}^{$1}/; + s/ \|\|\| /},\\textrm{{\\emph /; + chomp; + print "$x & \$ $_}} \\rangle \$ \\\\\n"; + $x=""; +} -- cgit v1.2.3