From 0806f2aef343a2892d295d8772199dad2a6427c6 Mon Sep 17 00:00:00 2001 From: Jonas Date: Sun, 7 Jul 2013 11:56:42 +0200 Subject: Handle all weekday combinations. --- bin/rdf2hours | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'bin/rdf2hours') diff --git a/bin/rdf2hours b/bin/rdf2hours index 340494c..a53995c 100755 --- a/bin/rdf2hours +++ b/bin/rdf2hours @@ -329,19 +329,31 @@ sub specdescribe { # TODO: translate properly $weekdays =~ s/1, 2, 3, 4, 5, 6, 7/alle ugedage/; + $weekdays =~ s/1, 2, 3, 4, 5, 6/mandag-lørdag/; $weekdays =~ s/1, 2, 3, 4, 5/mandag-fredag/; $weekdays =~ s/1, 2, 3, 4/mandag-torsdag/; + $weekdays =~ s/1, 2, 3/mandag-onsdag/; + $weekdays =~ s/1, 2/mandag-tirsdag/; + $weekdays =~ s/1/mandag/; $weekdays =~ s/2, 3, 4, 5, 6, 7/tirsdag-søndag/; $weekdays =~ s/2, 3, 4, 5, 6/tirsdag-lørdag/; $weekdays =~ s/2, 3, 4, 5/tirsdag-fredag/; - $weekdays =~ s/3, 4, 5/onsdag-fredag/; - $weekdays =~ s/^2, 3, 4(|, [^5].*)$/tirsdag-torsdag$1/; - $weekdays =~ s/^(|.*?[\d^5], |.*?(?!fredag, ))6, 7(.*)$/$1weekend$2/; - $weekdays =~ s/1/mandag/; + $weekdays =~ s/2, 3, 4/tirsdag-torsdag/; + $weekdays =~ s/2, 3/tirsdag-onsdag/; $weekdays =~ s/2/tirsdag/; + $weekdays =~ s/3, 4, 5, 6, 7/onsdag-søndag/; + $weekdays =~ s/3, 4, 5, 6/onsdag-lørdag/; + $weekdays =~ s/3, 4, 5/onsdag-fredag/; + $weekdays =~ s/3, 4/onsdag-torsdag/; $weekdays =~ s/3/onsdag/; + $weekdays =~ s/4, 5, 6, 7/torsdag-søndag/; + $weekdays =~ s/4, 5, 6/torsdag-lørdag/; + $weekdays =~ s/4, 5/torsdag-fredag/; $weekdays =~ s/4/torsdag/; + $weekdays =~ s/5, 6, 7/fredag-søndag/; + $weekdays =~ s/5, 6/fredag-lørdag/; $weekdays =~ s/5/fredag/; + $weekdays =~ s/6, 7/weekend/; $weekdays =~ s/6/lørdag/; $weekdays =~ s/7/søndag/; $weekdays =~ s/8/helligdage/; -- cgit v1.2.3