Skip to content
Browse files

Use host as well in mk-proiel-tests.pl.

  • Loading branch information...
1 parent 56afbcc commit 050393cc4482c057d0cf973d09059f85798877ea @arnsholt committed
Showing with 10 additions and 4 deletions.
  1. +2 −1 Makefile
  2. +8 −3 tools/mk-proiel-tests.pl
View
3 Makefile
@@ -1,6 +1,7 @@
SHELL=/bin/bash
SQLUSER?=arne
SQLDB?=proiel
+SQLHOST?=localhost
.PHONY: test clean src/latin.fst
@@ -17,7 +18,7 @@ test: latin.fst t/99-proiel-bg.t t/99-proiel-vulgata.t
prove -It/ -r t/
t/99-proiel-bg.t t/99-proiel-vulgata.t: tools/mk-proiel-tests.pl
- ./tools/mk-proiel-tests.pl --user=$(SQLUSER) --db=$(SQLDB) --password=$(SQLPASS)
+ ./tools/mk-proiel-tests.pl --user=$(SQLUSER) --db=$(SQLDB) --password=$(SQLPASS) --host=$(SQLHOST)
clean:
make -C src clean
View
11 tools/mk-proiel-tests.pl
@@ -120,13 +120,18 @@
'Vd' => '+Verb+Dep', # Hack to handle deponent verbs.
);
-my ($user, $pass, $db);
+#my ($user, $pass, $db, $host);
+my $user = $ENV{SQLUSER} // 'arne';
+my $pass = $ENV{SQLPASS};
+my $db = $ENV{SQLDB} // 'proiel';
+my $host = $ENV{SQLHOST} // 'localhost';
my $result = GetOptions('user=s' => \$user,
'password=s' => \$pass,
- 'db=s', => \$db,);
+ 'db=s', => \$db,
+ 'host=s', => \$host,);
exit 1 if not $result;
-my $dbh = DBI->connect("DBI:mysql:database=$db", $user, $pass, {RaiseError => 1, AutoCommit => 1});
+my $dbh = DBI->connect("DBI:mysql:database=$db;host=$host", $user, $pass, {RaiseError => 1, AutoCommit => 1});
my $query = <<'SQL';
SELECT DISTINCT l.part_of_speech pos, l.lemma lemma, t.form form, t.morphology msd
FROM lemmata l, tokens t, sentences s, source_divisions sd

0 comments on commit 050393c

Please sign in to comment.
Something went wrong with that request. Please try again.