-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dataframe matchbox Implementations #387
Merged
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
68922a2
Issue-368
0db0093
Issue238
5817bf5
Issue238
d65cb41
Merge branch 'master' of https://github.com/SinghGursimran/aut
4e5a066
test
c60104f
Merge branch 'master' of https://github.com/archivesunleashed/aut
f18006e
Merge branch 'master' of https://github.com/archivesunleashed/aut
9141e2f
Merge branch 'master' of https://github.com/archivesunleashed/aut
9c172a9
Merge branch 'master' of https://github.com/archivesunleashed/aut int…
8bd5634
Matchbox-Implementations
a10a41d
review_changes
21e29f3
changes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
package io.archivesunleashed.matchbox | ||
|
||
/** Gets different parts of a dateString. */ | ||
object ExtractDate { | ||
object ExtractDateRDD { | ||
object DateComponent extends Enumeration { | ||
/** An enum specifying years, months, days or a combination. */ | ||
type DateComponent = Value | ||
|
@@ -49,4 +49,29 @@ object ExtractDate { | |
"" | ||
} | ||
} | ||
|
||
/** Extracts the wanted date component from a date (for DataFrames). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's reword this to: Extracts a provided date component from a date (for DataFrames). |
||
* | ||
* @param fullDate date returned by `WARecord.getCrawlDate`, formatted as YYYYMMDD | ||
* @param dateFormat in String format | ||
*/ | ||
def apply(fullDate: String, dateFormat: String): String = { | ||
val startSS = 0 | ||
val yearSS = 4 | ||
val monthSS = 6 | ||
val daySS = 8 | ||
val maybeFullDate: Option[String] = Option(fullDate) | ||
maybeFullDate match { | ||
case Some(fulldate) => | ||
dateFormat match { | ||
case "YYYY" => fullDate.substring(startSS, yearSS) | ||
case "MM" => fullDate.substring(yearSS, monthSS) | ||
case "DD" => fullDate.substring(monthSS, daySS) | ||
case "YYYYMM" => fullDate.substring(startSS, monthSS) | ||
case _ => fullDate.substring(startSS, daySS) | ||
} | ||
case None => | ||
"" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this blank line.