Skip to content

Commit

Permalink
Merge pull request #21 from UAlbertaALTLab/hide-linguistic-tags
Browse files Browse the repository at this point in the history
Hide linguistic tags
  • Loading branch information
Madoshakalaka authored Dec 16, 2020
2 parents 92cc03a + 5129043 commit 11d28f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/transover_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Core.parseAPIResponse = (data, word, sendResponse) => {
definition_list.push(definition.text + '; ' + definition.source_ids.join(' '))
}
)
output.push({pos: result.lemma_wordform.text + result.lemma_wordform.analysis, meanings: definition_list})
output.push({lemma: result.lemma_wordform.text, meanings: definition_list})
})

}
Expand Down
4 changes: 3 additions & 1 deletion lib/transover_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ TransOver.formatTranslation = function(translation) {

if (translation instanceof Array) {
// translation was successful

// todo: why's the argument called pos_block?
translation.forEach(function(pos_block) {
const formatted_pos = pos_block.pos ? '<strong>'+pos_block.pos+'</strong>: ' : ''
const formatted_pos = pos_block.lemma ? '<strong>'+pos_block.lemma+'</strong>: ' : ''
const formatted_meanings = pos_block.meanings.slice(0,5).join(', ') + ( pos_block.meanings.length > 5 ? '...' : '' )
formatted_translation = formatted_translation + '<div class="pos_translation ' + '">' + formatted_pos + formatted_meanings + '</div>'
})
Expand Down

0 comments on commit 11d28f3

Please sign in to comment.