Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Wiki Rasa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tm-chatbot
Wiki Rasa
Commits
a45c02eb
Commit
a45c02eb
authored
6 years ago
by
Lucas Schons
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-get_birthdate' into 'master'
Fix get_birthdate See merge request
!33
parents
9945b3bb
fde1d815
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!33
Fix get_birthdate
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
processing/wikiproc/R/get_birthdate.R
+2
-2
2 additions, 2 deletions
processing/wikiproc/R/get_birthdate.R
processing/wikiproc/R/utils.R
+1
-1
1 addition, 1 deletion
processing/wikiproc/R/utils.R
with
3 additions
and
3 deletions
processing/wikiproc/R/get_birthdate.R
+
2
−
2
View file @
a45c02eb
...
@@ -63,7 +63,7 @@ getIntroduction <- function(article) {
...
@@ -63,7 +63,7 @@ getIntroduction <- function(article) {
xml2
::
xml_add_sibling
(
"p"
,
"\n"
)
xml2
::
xml_add_sibling
(
"p"
,
"\n"
)
xml2
::
xml_find_all
(
page
,
".//br"
)
%>%
xml2
::
xml_find_all
(
page
,
".//br"
)
%>%
xml2
::
xml_remove
xml2
::
xml_remove
(
.
)
# Get all paragraphs
# Get all paragraphs
paragraphs
<-
page
%>%
paragraphs
<-
page
%>%
...
@@ -73,7 +73,7 @@ getIntroduction <- function(article) {
...
@@ -73,7 +73,7 @@ getIntroduction <- function(article) {
# There will be some leading paragraphs containing only "\n"
# There will be some leading paragraphs containing only "\n"
# Remove those leading paragraphs
# Remove those leading paragraphs
remove
<-
c
(
"\n"
)
remove
<-
c
(
"\n"
)
cleaned
<-
data.table
::
setdiff
(
paragraphs
,
remove
)
cleaned
<-
setdiff
(
paragraphs
,
remove
)
introduction
<-
cleaned
[
1
]
introduction
<-
cleaned
[
1
]
# Return first paragraph
# Return first paragraph
...
...
This diff is collapsed.
Click to expand it.
processing/wikiproc/R/utils.R
+
1
−
1
View file @
a45c02eb
...
@@ -27,7 +27,7 @@ get_infobox <- function(article) {
...
@@ -27,7 +27,7 @@ get_infobox <- function(article) {
xml2
::
xml_add_sibling
(
"p"
,
"\n"
)
xml2
::
xml_add_sibling
(
"p"
,
"\n"
)
xml2
::
xml_find_all
(
page
,
".//br"
)
%>%
xml2
::
xml_find_all
(
page
,
".//br"
)
%>%
xml2
::
xml_remove
()
xml2
::
xml_remove
(
.
)
# Get the info box
# Get the info box
# Will throw an error if there isnt any, so that should be checked beforehand
# Will throw an error if there isnt any, so that should be checked beforehand
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment