[Vwgh-commits] r10 - pkg/R

commits at r-forge.r-project.org commits at r-forge.r-project.org
Fri Feb 8 17:23:13 CET 2008


Author: webtraveller
Date: 2008-02-08 17:23:13 +0100 (Fri, 08 Feb 2008)
New Revision: 10

Modified:
   pkg/R/result.R
   pkg/R/testcheck.R
Log:
Modify File GZ

Modified: pkg/R/result.R
===================================================================
--- pkg/R/result.R	2008-02-08 15:02:19 UTC (rev 9)
+++ pkg/R/result.R	2008-02-08 16:23:13 UTC (rev 10)
@@ -10,7 +10,7 @@
 		mx3 <- 0
 
 		## Ignoring `Mehrbegehren`
-		x <- unlist(strsplit(x,"mehrbegehren"))[1]
+		x <- unlist(strsplit(x,"mehrbegehren|(kosten)ersatzbegehren|kosten(mehr)begehren"))[1]
 
 		## 6 Grundkategorien
 
@@ -24,7 +24,7 @@
 
 
 		## Aufhebung
-		pat3="aufgehoben|erteilt|folge gegeben|bewilligt|rechtswidrig|berichtigt|geb.hrt dem Beschwerdef.hrer|erlassen|angeordnet"
+		pat3="aufgehoben|erteilt|folge gegeben|rechtswidrig|berichtigt|geb.hrt dem Beschwerdef.hrer|erlassen|angeordnet"
 
 		#pat3X <- "stattgegeben"
 
@@ -32,7 +32,7 @@
 		pat4 <- "eingestellt"
 
 		## Beschluss
-		pat5="beschlu.|stattgegeben"
+		pat5="beschlu.|stattgegeben|bewilligt"
 
 		## Vorabentscheidung
 		pat6="vorabentscheidung"
@@ -173,8 +173,9 @@
                                 }
 				else 
 				{
-                                  if (sp[3] == 1 ) res <- 9
-                                  else res <- sp[1]*10^5+sp[2]*2*10^4+sp[3]*3*10^3+sp[4]*4*10^2+sp[5]*5*10^1+sp[6]*6*10^0
+                                  #if (sp[3] == 1 ) res <- 9
+                                  #else 
+				  res <- sp[1]*10^5+sp[2]*2*10^4+sp[3]*3*10^3+sp[4]*4*10^2+sp[5]*5*10^1+sp[6]*6*10^0
 				}
 			}
 

Modified: pkg/R/testcheck.R
===================================================================
--- pkg/R/testcheck.R	2008-02-08 15:02:19 UTC (rev 9)
+++ pkg/R/testcheck.R	2008-02-08 16:23:13 UTC (rev 10)
@@ -1,12 +1,15 @@
-testcheck <- function(x,y)
+testcheck <- function(x,y,z = c())
 {
 	cat("Performing catagorising check\n")
+	if (length(z) == 0 ) cat("No Ignore List")
+	else cat("Ignore List active")
 	db_query <- dbGetQuery(x,"select spruch,result from Rechtsinformationssystem,Result where Rechtsinformationssystem.SP_Nr == Result.SP_Nr")
 	sample_query<- dbGetQuery(y,"select SP_Nr,Entscheidung from resultcheck")
 	ll <- length(sample_query[,2])
 	i <- 1
 	rr <- 0
 	ff <- 0
+	ig <- 0
 	ff_sp <- c()
 	xx <- 0
 	xx_sp <- c()
@@ -14,41 +17,45 @@
 	err1 <- c()
 	err2 <- c()
 	err3 <- c()
-	cat ("Starting ... ")
+	cat("\r")
 	while (i <= ll) 
 	{	
-		cat("Status: Richtig: ",rr,"  Falsch: ",ff,"  Unclassed: ",xx," Aufarbeitung: (",proz,")")
+		cat("Status: Richtig: ",rr,"  Falsch: ",ff," Ignore: ",ig," Unclassed: ",xx," Aufarbeitung: (",proz,")")
 		proz <- round((i/ll)*100,2)	
 		c_sp_nr <- sample_query[i,1]
 		res <- db_query[c_sp_nr,2]
 		res_sp <- sample_query[i,2]
-		if ( res == res_sp ) 
+		if ( sum(unlist(lapply(z, function(z) grep(c_sp_nr,z)))) == 1 ) ig <- ig + 1
+		else
 		{
+			if ( res == res_sp ) 
+			{
 			rr <- rr + 1
-		}
-		else	
-		{
-			if ((res == -10 ) || (res >= 10)) 
-			{
-				xx <- xx + 1
-				xx_sp <- c(xx_sp,c_sp_nr)
-				#cat("\n",xx_sp,"\n")
 			}
-			else 
+			else	
 			{
-				ff <- ff + 1
-				ff_sp <- c(ff_sp,c_sp_nr)			
-			}
-			err1 <- c(err1,db_query[c_sp_nr,1])
-			err2 <-	c(err2,db_query[c_sp_nr,2])
-			err3 <- c(err3,sample_query[i,2])		
-		} 
+				if ((res == -10 ) || (res >= 10)) 
+				{
+					xx <- xx + 1
+					xx_sp <- c(xx_sp,c_sp_nr)
+					#cat("\n",xx_sp,"\n")
+				}
+				else 
+				{
+					ff <- ff + 1
+					ff_sp <- c(ff_sp,c_sp_nr)			
+				}
+				err1 <- c(err1,db_query[c_sp_nr,1])
+				err2 <-	c(err2,db_query[c_sp_nr,2])
+				err3 <- c(err3,sample_query[i,2])		
+			} 
+		}
 		i <- i +1
 		cat("\r")
 	}	
-	cat("Starting ... DONE                                                                                      \n")
+	cat("Starting ... DONE                                                                                                                    \n")
 	err <- cbind(err1,err2,err3)
-	cat ("Final: Richtig: ",rr," (",round(rr/ll*100,2),")    Falsch: ",ff, "(",round(ff/ll*100,2),")      Unclassed: ",xx, "(",round(xx/ll*100,2),")\n\n")
+	cat ("Final: Richtig: ",rr," (",round(rr/ll*100,2),")    Falsch: ",ff, "(",round(ff/ll*100,2),")  Ignore: ",ig, "(",round(ig/ll*100,2),")    Unclassed: ",xx, "(",round(xx/ll*100,2),")\n\n")
 	xx_sp <<- xx_sp
 	ff_sp <<- ff_sp
 	write.csv(file="false.csv",err)	



More information about the Vwgh-commits mailing list