Skip to content

Basic MPN standardization#12

Merged
codingnirvana merged 6 commits intomasterfrom
mpn
Apr 17, 2018
Merged

Basic MPN standardization#12
codingnirvana merged 6 commits intomasterfrom
mpn

Conversation

@subbaraonv
Copy link
Copy Markdown

@subbaraonv subbaraonv commented Apr 16, 2018

No description provided.


object MPN {
// Some domain specific keywords known to be invalid
val BlackListedMpns = Set("unknown", "none", "does not apply", "non applicable", "various")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets also add n/a and na to this list

else words.forall(w => w == WordUtils.capitalizeFully(w) && !StringUtils.isNumeric(w))
}

def standardizeMPN(input: String): String = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the return type as Option[String]?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we add this as an UDF, that part of the code can have the return type as string.

}

it should "validate identifier" in {
MPN.isValidIdentifier("") should be (false)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets also add the null test case

@subbaraonv
Copy link
Copy Markdown
Author

@codingnirvana please check now

@codingnirvana
Copy link
Copy Markdown

LGTM. Merging it.

@codingnirvana codingnirvana merged commit 60cc20c into master Apr 17, 2018
@subbaraonv subbaraonv deleted the mpn branch April 18, 2018 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants