-
Notifications
You must be signed in to change notification settings - Fork 1
/
frequencies.ts
178 lines (163 loc) · 4.01 KB
/
frequencies.ts
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
// SPDX-FileCopyrightText: 2021 Andre 'Staltz' Medeiros
//
// SPDX-License-Identifier: MIT
export = {
/**
* Distribution of msg types, based on
* https://github.com/arj03/ssb-new-format#message-types.
*
* Not normalized.
*/
MSG_TYPE_FREQUENCIES: {
vote: 291505,
post: 168091,
contact: 59912,
private: 82034,
about: 11528,
other: 62462
},
/**
* Distribution of the approximate size of msgs of type 'post'.
* Based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
POST_SIZE_FREQUENCIES: {
short: 0.25,
medium: 0.4,
long: 0.35,
},
/**
* Probability of msgs of type 'post' to include a 'channel' field.
* Based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
POST_CHANNEL_FREQUENCY: 0.3,
/**
* Probability of msgs of type 'post' to include a 'mentions' field.
* Based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
POST_MENTIONS_FREQUENCY: 0.6,
/**
* Distribution of types of mentions in msgs of type 'post'.
* Based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
MENTION_LINK_FREQUENCIES: {
author: 0.6,
blob: 0.3,
channel: 0.1,
},
/**
* Probability of a mention of a blob to include a 'name' field.
* Based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
MENTION_BLOB_NAME_FREQUENCY: 0.2,
/**
* Probability of msgs of type 'post' to be a reply to another msg.
* Based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
POST_REPLY_FREQUENCY: 0.7,
/**
* Probability of replies to be a fork of an existing thread.
* Based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
POST_REPLY_FORK_FREQUENCY: 0.7,
/**
* Probability of msgs of type 'vote' to have a negative value.
* Based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
VOTE_NEGATIVE_FREQUENCY: 0.05,
/**
* Distribution of subtypes of msgs of type 'contact', indicating following or
* blocking or unfollowing or unblocking.
* Based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
CONTACT_TYPE_FREQUENCIES: {
follow: 0.7,
unfollow: 0.1,
block: 0.15,
unblock: 0.05,
},
/**
* Distribution of blob MIME types, based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
BLOB_TYPE_FREQUENCIES: {
'image/jpeg': 0.5,
'image/png': 0.5,
},
/**
* Distribution of image blob MIME types, based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
BLOB_IMAGE_TYPE_FREQUENCIES: {
'image/jpeg': 0.5,
'image/png': 0.5,
},
/**
* Distribution of subtypes of msgs of type 'about', whether they include the
* fields "name", "description", or "image".
* Based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
ABOUT_TYPE_FREQUENCIES: {
name: 0.3,
image: 0.2,
description: 0.1,
name_and_image: 0.2,
name_and_description: 0.1,
image_and_description: 0.05,
name_and_image_and_description: 0.05,
},
/**
* Distribution of the shape of "content.image" in msgs of type 'about'.
* Based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
ABOUT_IMAGE_TYPE_FREQUENCIES: {
string: 0.5,
big_object: 0.4,
small_object: 0.1,
},
/**
* Probability of msgs of type 'about' to be targeted at someone else than the
* about's author.
* Based on staltz's intuition.
* FIXME: base this on analysis of real world data
*
* Normalized.
*/
ABOUT_OTHER_FREQUENCY: 0.02,
};