forked from D-Net/dnet-hadoop
added check for null value during doi normalization
This commit is contained in:
parent
0892cad4e8
commit
7177c25261
|
@ -358,6 +358,8 @@ object DoiBoostMappingUtil {
|
||||||
def isEmpty(x: String) = x == null || x.trim.isEmpty
|
def isEmpty(x: String) = x == null || x.trim.isEmpty
|
||||||
|
|
||||||
def normalizeDoi(input : String) :String ={
|
def normalizeDoi(input : String) :String ={
|
||||||
|
if(input == null)
|
||||||
|
return null
|
||||||
val replaced = input.replaceAll("(?:\\n|\\r|\\t|\\s)", "").toLowerCase.replaceFirst(DOI_PREFIX_REGEX, DOI_PREFIX)
|
val replaced = input.replaceAll("(?:\\n|\\r|\\t|\\s)", "").toLowerCase.replaceFirst(DOI_PREFIX_REGEX, DOI_PREFIX)
|
||||||
if (isEmpty(replaced))
|
if (isEmpty(replaced))
|
||||||
return null
|
return null
|
||||||
|
|
Loading…
Reference in New Issue