Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
histhub
wikidata-lib
Commits
d7b9a6f0
Commit
d7b9a6f0
authored
Oct 10, 2019
by
tobinski
Browse files
Better detect names
parent
62e00a59
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/wikidata-normalizer-transformer.ts
View file @
d7b9a6f0
...
@@ -195,8 +195,16 @@ class WikidataNormalizerTransformer extends Transform {
...
@@ -195,8 +195,16 @@ class WikidataNormalizerTransformer extends Transform {
if
(
name2
!==
null
)
{
if
(
name2
!==
null
)
{
return
name2
;
return
name2
;
}
}
const
name3
=
this
.
getAlternativNames
(
obj
)[
0
];
if
(
name3
!==
null
)
{
return
name3
;
}
// this often fails. Then we use null from the catch
const
lang
=
Object
.
keys
(
obj
.
labels
)[
0
];
return
obj
.
labels
[
lang
].
value
;
return
this
.
getAlternativNames
(
obj
)[
0
];
}
catch
(
error
)
{
}
catch
(
error
)
{
return
null
;
return
null
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment