[codeface] [PATCH 2/4] Fix case where only an email is available

  • From: Mitchell Joblin <mitchell.joblin.ext@xxxxxxxxxxx>
  • To: codeface@xxxxxxxxxxxxx
  • Date: Fri, 2 Oct 2015 10:44:43 +0200

- The email analysis has issues when no name is proved so
we create one from the email

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@xxxxxxxxxxx>
---
codeface/R/ml/analysis.r | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/codeface/R/ml/analysis.r b/codeface/R/ml/analysis.r
index 7e7698f..2f97cb4 100644
--- a/codeface/R/ml/analysis.r
+++ b/codeface/R/ml/analysis.r
@@ -248,6 +248,11 @@ check.corpus.precon <- function(corp.base) {
email <- paste('could.not.resolve@', name, sep="")
}

+ ## In some cases only an email is provided
+ if (name=="") {
+ name <- gsub("\\.", " ",gsub("@.*", "", email))
+ }
+
author <- paste(name, ' <', email, '>', sep="")
}
else {
--
2.1.4


Other related posts:

  • » [codeface] [PATCH 2/4] Fix case where only an email is available - Mitchell Joblin