This repository was archived by the owner on Apr 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.fsx
More file actions
74 lines (60 loc) · 1.18 KB
/
utils.fsx
File metadata and controls
74 lines (60 loc) · 1.18 KB
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
open System
type UserData = {
userTweets: Set<string>
following: Set<string>
followers: Set<string>
}
type Tweets = {
userid: string
text: string
time_of_tweet: DateTime
retweet: bool
}
type Mentions = {
mentionedTweets: Set<string>
}
type Hashtags = {
hashtaggedTweets: Set<string>
}
type UserMessage = {
message: string
content: string
}
type Register = {
id: string
}
type Follow = {
myId: string
toFollow: string
}
type Retweet = {
id: string
tid: string
}
type Search = {
queryType: string
query: string
}
type Connect = {
id: string
}
type Disconnect = {
id: string
}
type Remove = {
id: string
}
let mentionParser (message: string) =
let mutable mentions: Set<string> = Set.empty
let words = message.Trim().Split ' '
for word in words do
if word.[0] = '@' then
mentions <- mentions.Add(word.ToLower())
mentions
let hashtagParser (message: string) =
let mutable hashtags: Set<string> = Set.empty
let words = message.Trim().Split ' '
for word in words do
if word.[0] = '#' then
hashtags <- hashtags.Add(word.ToLower())
hashtags