-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathsentence_config.coffee
82 lines (72 loc) · 2.75 KB
/
sentence_config.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
###
# Sentence Type
###
# JittaLine
exports.jittaline =
getSimpleSentenceList: (data, simpleSentences) ->
if typeof data.displayInfo.oldLine != 'undefined'
group = data.displayInfo.oldLine + "_" + data.displayInfo.newLine
if(simpleSentences[data.sentenceType] && simpleSentences[data.sentenceType][group])
simpleSentences[data.sentenceType][group][data.level]
else
['Error']
else
simpleSentences.default.na
# Earning
exports.earning =
getSimpleSentenceList: (data, simpleSentences) ->
if(simpleSentences[data.sentenceType] && simpleSentences[data.sentenceType][data.newScore])
simpleSentences[data.sentenceType][data.newScore]
else
['Error']
# Operating
exports.operating =
getSimpleSentenceList: (data, simpleSentences) ->
if(simpleSentences[data.sentenceType] && simpleSentences[data.sentenceType][data.levelType])
simpleSentences[data.sentenceType][data.levelType]
else
['Error']
# Debt
exports.debt =
getSimpleSentenceList: (data, simpleSentences) ->
if(simpleSentences[data.sentenceType] && simpleSentences[data.sentenceType].all)
simpleSentences[data.sentenceType].all
else
['Error']
# Return on Equity
exports.roe =
getSimpleSentenceList: (data, simpleSentences) ->
oldScore = if typeof data.oldScore == 'undefined' then 0 else data.oldScore
if(simpleSentences[data.sentenceType] && simpleSentences[data.sentenceType][oldScore] && simpleSentences[data.sentenceType][oldScore][data.newScore])
simpleSentences[data.sentenceType][oldScore][data.newScore]
else
['Error']
# Dividend Payout
exports.dividend =
getSimpleSentenceList: (data, simpleSentences) ->
if(simpleSentences[data.sentenceType] && simpleSentences[data.sentenceType][data.levelType])
simpleSentences[data.sentenceType][data.levelType]
else
['Error']
# Share Repurchase
exports.repurchase =
getSimpleSentenceList: (data, simpleSentences) ->
oldScore = if typeof data.oldScore == 'undefined' then 0 else data.oldScore
if(simpleSentences[data.sentenceType] && simpleSentences[data.sentenceType][oldScore] && simpleSentences[data.sentenceType][oldScore][data.newScore])
simpleSentences[data.sentenceType][oldScore][data.newScore]
else
['Error']
# CapEx
exports.capex =
getSimpleSentenceList: (data, simpleSentences) ->
if(simpleSentences[data.sentenceType] && simpleSentences[data.sentenceType][data.levelType])
simpleSentences[data.sentenceType][data.levelType]
else
['Error']
# Error
exports.capex =
getSimpleSentenceList: (data, simpleSentences) ->
if(simpleSentences[data.sentenceType] && simpleSentences[data.sentenceType][data.levelType])
simpleSentences[data.sentenceType][data.levelType]
else
['Error']