Skip to content

Commit

Permalink
feat: export word association (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
troggy authored Nov 28, 2019
1 parent e78d338 commit d383cda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/js/extractWordData.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const extractWordData = (word) => {
const image = wordPicture(userTranslations) || wordPicture(word.translations)
const sound = `[sound:${word.pronunciation}]`
const groups = (word.wordSets || []).map(ws => ws.name).join(',')
const association = sanitizeString(word.association)

return {
word: wordValue,
Expand All @@ -69,6 +70,7 @@ const extractWordData = (word) => {
context: highlightedContext,
sound,
groups,
association,
clozefiedContext
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/js/toCsv.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const encloseInDoubleQuotes = string => {
const wordToCSV = (rawWord, wordSetsMap) => {
const {
word, translations, image, transcription,
context, sound, groups, clozefiedContext
context, sound, groups, association, clozefiedContext
} = extractWordData(rawWord, wordSetsMap)
return [
word,
Expand All @@ -18,7 +18,8 @@ const wordToCSV = (rawWord, wordSetsMap) => {
context,
sound,
groups,
clozefiedContext
clozefiedContext,
association
]
.map(encloseInDoubleQuotes)
.join(';')
Expand Down

0 comments on commit d383cda

Please sign in to comment.