Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beta.ordbok.uib.no
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Språksamlingane
beta.ordbok.uib.no
Commits
495f3f56
Commit
495f3f56
authored
3 years ago
by
Henrik Askjer
Browse files
Options
Downloads
Patches
Plain Diff
fix lemma group inclection codes
parent
0bb07bff
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Header.vue
+30
-31
30 additions, 31 deletions
src/components/Header.vue
with
30 additions
and
31 deletions
src/components/Header.vue
+
30
−
31
View file @
495f3f56
...
@@ -29,8 +29,8 @@
...
@@ -29,8 +29,8 @@
<h2
class=
"secondary_header"
<h2
class=
"secondary_header"
v-if=
"secondary_header_text.length"
>
{{
secondary_header_text
}}
</h2>
v-if=
"secondary_header_text.length"
>
{{
secondary_header_text
}}
</h2>
<span
class=
"header_group_list"
<span
class=
"header_group_list"
v-if=
"
group_list
.length"
>
{{
lemma_group
.
description
}}
</span>
v-if=
"
lemma_group.description
.length"
>
{{
lemma_group
.
description
}}
</span>
<span
v-if=
"$store.state.showInflectionNo"
>
{{
inflection_classes
}}
</span>
<span
v-if=
"$store.state.showInflectionNo"
>
{{
lemma_group
.
inflection_classes
}}
</span>
<SplitInf
:lemmas=
"lemmas"
/>
<SplitInf
:lemmas=
"lemmas"
/>
<span
v-if=
"!lemma_groups[1] && $parent.collapsed && $parent.snippet && $parent.has_content"
class=
"definition_snippet"
>
<span
v-if=
"!lemma_groups[1] && $parent.collapsed && $parent.snippet && $parent.has_content"
class=
"definition_snippet"
>
...
@@ -88,7 +88,28 @@ export default {
...
@@ -88,7 +88,28 @@ export default {
},
},
methods
:
{
methods
:
{
roman_hgno
:
helpers
.
roman_hgno
roman_hgno
:
helpers
.
roman_hgno
,
inflection_classes
:
function
(
lemmas
)
{
let
inf_classes
=
new
Set
()
let
ureg
=
false
lemmas
.
forEach
((
lemma
,
i
)
=>
{
if
(
lemma
.
inflection_class
)
inf_classes
.
add
(
lemma
.
inflection_class
)
else
ureg
=
true
})
if
(
inf_classes
.
size
){
let
class_array
=
Array
.
from
(
inf_classes
).
sort
()
if
(
ureg
)
class_array
.
push
(
"
ureg.
"
)
let
class_list
if
(
class_array
.
length
<
3
)
{
class_list
=
class_array
.
join
(
"
og
"
)
}
else
{
class_list
=
class_array
.
slice
(
0
,
-
1
).
join
(
"
,
"
)
+
"
og
"
+
class_array
[
class_array
.
length
-
1
]
}
return
"
(
"
+
class_list
+
"
)
"
}
}
},
},
computed
:
{
computed
:
{
secondary_header_text
:
function
()
{
secondary_header_text
:
function
()
{
...
@@ -123,7 +144,7 @@ export default {
...
@@ -123,7 +144,7 @@ export default {
return
helpers
.
group_list
(
this
.
lemmas
,
this
.
dictionary
)
return
helpers
.
group_list
(
this
.
lemmas
,
this
.
dictionary
)
},
},
lemma_groups
:
function
()
{
lemma_groups
:
function
()
{
let
groups
let
groups
=
[{
lemmas
:
this
.
lemmas
}]
if
(
this
.
lemmas
[
0
].
paradigm_info
[
0
]
&&
this
.
lemmas
[
0
].
paradigm_info
[
0
].
tags
[
0
]
!=
'
NOUN
'
&&
this
.
lemmas
[
0
].
paradigm_info
[
0
].
tags
[
0
]
!=
'
EXPR
'
)
{
if
(
this
.
lemmas
[
0
].
paradigm_info
[
0
]
&&
this
.
lemmas
[
0
].
paradigm_info
[
0
].
tags
[
0
]
!=
'
NOUN
'
&&
this
.
lemmas
[
0
].
paradigm_info
[
0
].
tags
[
0
]
!=
'
EXPR
'
)
{
groups
=
[{
description
:
helpers
.
mapping
[
this
.
dictionary
][
this
.
lemmas
[
0
].
paradigm_info
[
0
].
tags
[
0
]],
lemmas
:
this
.
lemmas
}]
groups
=
[{
description
:
helpers
.
mapping
[
this
.
dictionary
][
this
.
lemmas
[
0
].
paradigm_info
[
0
].
tags
[
0
]],
lemmas
:
this
.
lemmas
}]
}
}
...
@@ -147,38 +168,16 @@ export default {
...
@@ -147,38 +168,16 @@ export default {
else
{
else
{
genus_map
[
genus_description
]
=
[
lemma
]
genus_map
[
genus_description
]
=
[
lemma
]
}
}
})
})
groups
=
Object
.
keys
(
genus_map
).
map
(
key
=>
{
groups
=
Object
.
keys
(
genus_map
).
map
(
key
=>
{
return
{
description
:
'
substantiv
'
+
key
,
lemmas
:
genus_map
[
key
]}
return
{
description
:
'
substantiv
'
+
key
,
lemmas
:
genus_map
[
key
]
,
}
})
})
groups
.
forEach
((
lemma_group
,
index
)
=>
{
groups
[
index
][
'
inflection_classes
'
]
=
this
.
inflection_classes
(
lemma_group
.
lemmas
)
})
}
}
return
groups
||
[{
lemmas
:
this
.
lemmas
}]
return
groups
},
inflection_classes
:
function
()
{
let
inf_classes
=
new
Set
()
let
ureg
=
false
this
.
lemmas
.
forEach
((
lemma
,
i
)
=>
{
if
(
lemma
.
inflection_class
)
inf_classes
.
add
(
lemma
.
inflection_class
)
else
ureg
=
true
})
if
(
inf_classes
.
size
){
let
class_array
=
Array
.
from
(
inf_classes
).
sort
()
if
(
ureg
)
class_array
.
push
(
"
ureg.
"
)
let
class_list
if
(
class_array
.
length
<
3
)
{
class_list
=
class_array
.
join
(
"
og
"
)
}
else
{
class_list
=
class_array
.
slice
(
0
,
-
1
).
join
(
"
,
"
)
+
"
og
"
+
class_array
[
class_array
.
length
-
1
]
}
return
"
(
"
+
class_list
+
"
)
"
}
},
},
inflection_groups_by_lemma
:
function
()
{
inflection_groups_by_lemma
:
function
()
{
let
components
=
Object
.
keys
(
this
.
$options
.
components
)
let
components
=
Object
.
keys
(
this
.
$options
.
components
)
...
...
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