Skip to content

Commit

Permalink
fix(urban-hyphen): incorrect labelling
Browse files Browse the repository at this point in the history
  • Loading branch information
drawnepicenter committed Aug 10, 2016
1 parent b0762db commit 9388081
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cmds/urban.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ exports.handler = (argv) => {
const list = body.list.slice(0, limit)
for (let i = 0; i <= list.length - 1; i++) {
const result = list[i]
themes.label(theme, 'down', 'Urban Dictionary', result.definition)
themes.label(theme, 'down', 'Definition', result.definition)
tofile[[`definition${i}`]] = result.definition
}
if (argv.o) tools.outFile(argv.o, argv.f, tofile)
Expand Down
12 changes: 6 additions & 6 deletions src/cmds/wordnik_cmds/hyphen.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,24 @@ exports.handler = (argv) => {
http({ url }, (error, response) => {
if (!error && response.statusCode === 200) {
const list = JSON.parse(response.body)
themes.label(theme, 'right', 'Hyphenation')
const hcont = []
for (let i = 0; i <= list.length - 1; i++) {
const item = list[i]
if (item.type === 'stress') {
process.stdout.write(`${chalk.red.bold(item.text)}`)
hcont.push(`${chalk.red.bold(item.text)}`)
tofile[[`stress${i}`]] = item.text
} else if (item.type === 'secondary stress') {
process.stdout.write(ctstyle(item.text))
hcont.push(ctstyle(item.text))
tofile[[`secondary${i}`]] = item.text
} else {
process.stdout.write(ctstyle(item.text))
hcont.push(ctstyle(item.text))
tofile[[`syllable${i}`]] = item.text
}
if (i < list.length - 1) {
process.stdout.write(ctstyle('-'))
hcont.push(ctstyle('-'))
}
}
console.log('')
themes.label(theme, 'right', 'Hyphenation', hcont.join(''))
if (argv.o) tools.outFile(argv.o, argv.f, tofile)
if (argv.s && config.merge) noon.save(CFILE, config)
if (argv.s && !config.merge) throw new Error("Can't save user config, set option merge to true.")
Expand Down

0 comments on commit 9388081

Please sign in to comment.