[Vwgh-commits] r12 - in pkg: . R

commits at r-forge.r-project.org commits at r-forge.r-project.org
Wed Feb 13 10:22:18 CET 2008


Author: martinkober
Date: 2008-02-13 10:22:18 +0100 (Wed, 13 Feb 2008)
New Revision: 12

Modified:
   pkg/DESCRIPTION
   pkg/R/duration_of_proc.R
Log:
duration modified

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2008-02-12 13:41:17 UTC (rev 11)
+++ pkg/DESCRIPTION	2008-02-13 09:22:18 UTC (rev 12)
@@ -1,12 +1,12 @@
 Package: VwGHat
 Type: Package
 Title: Mining Austrian administrative court rulings 
-Version: 0.8-1
-Date: 2008-02-01
+Version: 0.8-2
+Date: 2008-02-12
 Author: Martin Kober and Georg Zajko
-Maintainer: Martin Kober <martin.kober at wu-wien.ac.at>
-Description: Performs data extraction and mining of Austrian supreme administrative court rulings.
+Maintainer: Georg Zajko <georg.zajko at wu-wien.ac.at>
+Description: Performs data extraction and mining of Austrian supreme administrative court rulings (http://www.vwgh.gv.at).
 License: GPL-2
 Depends: XML, DBI
 Recommends: RSQLite
-
+Encoding: UTF-8

Modified: pkg/R/duration_of_proc.R
===================================================================
--- pkg/R/duration_of_proc.R	2008-02-12 13:41:17 UTC (rev 11)
+++ pkg/R/duration_of_proc.R	2008-02-13 09:22:18 UTC (rev 12)
@@ -8,19 +8,19 @@
 	month_list = c("Jänner"=1, Januar=1, Feber=2, Februar=2, "März"=3, April=4,
 		Mai=5, Juni=6, Juli=7, August=8, September=9, Oktober=10, November=11, Dezember=12)
 	month_pattern = paste(names(month_list), collapse="|");
+	pattern = paste("\\d{1,2}\\.\\W{1,4}(", month_pattern, ")\\D{1,4}\\d{4}", sep="")
+	matches = gregexpr(pattern, txt, perl=TRUE)[[1]]
 	
-	matches = gregexpr(paste("\\d{1,2}\\.\\s+(", month_pattern, ")\\s+\\d{4}", sep=""), txt, perl=TRUE)[[1]]
-	
 	if (matches[1] == -1) {  
 		## No date found in 'Betreff', let's try 'Begruendung'
 		txt = data[["Begruendung"]]
-		matches = gregexpr(paste("\\d{1,2}\\.\\s+(", month_pattern, ")\\s+\\d{4}", sep=""), txt, perl=TRUE)[[1]]
+		matches = gregexpr(pattern, txt, perl=TRUE)[[1]]
 	}
 
 	dates = c()
 	for (i in 1:length(matches)) {
 		d = substr(txt, matches[i], matches[i]+attr(matches, "match.length")[i]-1)
-		d = sub("(\\d{1,2})\\.\\s+([A-Za-zäöüßÄÖÜ]+)\\s+(\\d{4})", "\\3-\\2-\\1", d, perl=TRUE)
+		d = sub("(\\d{1,2})\\.\\W{1,4}([A-Za-zäöüßÄÖÜ]+)\\D{1,4}(\\d{4})", "\\3-\\2-\\1", d, perl=TRUE)
 		dd = strsplit(d, "-")[[1]]
 		dd[2] = month_list[dd[2]]
 		dates[i] = as.Date(paste(dd, collapse="-"), "%Y-%m-%d")



More information about the Vwgh-commits mailing list