00:01
cow[moo] has joined #ruby
00:02
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
00:03
mangold has joined #ruby
00:06
SeepingN has quit [Quit: The system is going down for reboot NOW!]
00:06
jottr has joined #ruby
00:09
ta_ has quit [Ping timeout: 252 seconds]
00:18
dviola has quit [Quit: WeeChat 2.3]
00:19
kentnl has quit [Remote host closed the connection]
00:20
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
00:20
kent\n has joined #ruby
00:24
apeiros has quit [Remote host closed the connection]
00:24
apeiros has joined #ruby
00:28
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
00:29
apparition has joined #ruby
00:29
apeiros has quit [Ping timeout: 264 seconds]
00:39
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
00:40
crankharder has quit [Remote host closed the connection]
00:41
shoogz has quit [Ping timeout: 264 seconds]
00:49
shoogz has joined #ruby
00:50
shoogz has joined #ruby
00:51
Nicmavr has quit [Read error: Connection reset by peer]
00:53
Nicmavr has joined #ruby
00:57
despai has quit [Ping timeout: 252 seconds]
00:57
jottr has quit [Ping timeout: 252 seconds]
01:03
houhoulis has joined #ruby
01:06
apeiros has joined #ruby
01:07
cthu| has quit [Ping timeout: 264 seconds]
01:10
mangold has quit [Quit: This computer has gone to sleep]
01:10
tfitts has quit [Quit: Connection closed for inactivity]
01:10
apeiros has quit [Ping timeout: 246 seconds]
01:12
nowhere_man has joined #ruby
01:15
bambanx has quit [Quit: Leaving]
01:18
impermanence has quit [Remote host closed the connection]
01:18
nadir has joined #ruby
01:21
Wojnar has quit [Ping timeout: 272 seconds]
01:30
elphe has quit [Ping timeout: 252 seconds]
01:40
apeiros has joined #ruby
01:42
cthu| has joined #ruby
01:43
bak1an has joined #ruby
01:44
apeiros has quit [Ping timeout: 246 seconds]
01:48
cthu| has quit [Ping timeout: 252 seconds]
01:48
Dimik has joined #ruby
01:48
Dimik has quit [Excess Flood]
01:48
Dimik has joined #ruby
01:49
Dimik has quit [Excess Flood]
01:50
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
01:51
darkhanb has joined #ruby
01:56
mangold has joined #ruby
02:00
pskosinski has quit [Ping timeout: 252 seconds]
02:01
pskosinski has joined #ruby
02:05
SuperL4g has joined #ruby
02:06
nexraf1 has quit [Ping timeout: 250 seconds]
02:08
ta_ has joined #ruby
02:12
apeiros has joined #ruby
02:15
hahuang6- has joined #ruby
02:17
apeiros has quit [Ping timeout: 252 seconds]
02:18
hahuang65 has quit [Ping timeout: 250 seconds]
02:28
dviola has joined #ruby
02:30
conceivably has joined #ruby
02:39
ta_ has quit [Ping timeout: 245 seconds]
02:42
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
02:46
nchambers has joined #ruby
02:51
apeiros has joined #ruby
02:52
noobineer has joined #ruby
02:52
elphe has joined #ruby
02:52
apparition has quit [Quit: Bye]
02:56
apeiros has quit [Ping timeout: 246 seconds]
02:56
Ekho- is now known as Ekho
03:05
braincrash has quit [Quit: bye bye]
03:09
braincrash has joined #ruby
03:12
nowhere_man has quit [Ping timeout: 252 seconds]
03:14
TheBloke has joined #ruby
03:17
orbyt_ has joined #ruby
03:21
nowhere_man has joined #ruby
03:21
eckhardt has joined #ruby
03:25
houhoulis has quit [Remote host closed the connection]
03:26
dviola has quit [Quit: WeeChat 2.3]
03:29
apeiros has joined #ruby
03:32
gh0sh- has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
03:34
apeiros has quit [Ping timeout: 252 seconds]
03:34
dinfuehr has quit [Ping timeout: 245 seconds]
03:35
dinfuehr has joined #ruby
03:36
xuanrui has joined #ruby
03:42
mangold has quit [Quit: This computer has gone to sleep]
03:42
nadir has quit [Quit: Connection closed for inactivity]
03:50
noobineer has quit [Ping timeout: 264 seconds]
03:55
asphyxia has joined #ruby
03:59
conceivably has quit [Ping timeout: 272 seconds]
04:00
apeiros has joined #ruby
04:06
apeiros has quit [Ping timeout: 264 seconds]
04:09
scott4000 has quit [Ping timeout: 250 seconds]
04:13
nicholaslyang has joined #ruby
04:19
j416 has quit [Quit: o/]
04:19
j416 has joined #ruby
04:25
ivanskie has joined #ruby
04:25
noobineer has joined #ruby
04:26
mikecmpbll has joined #ruby
04:28
jordanm has quit [Remote host closed the connection]
04:29
apeiros has joined #ruby
04:31
jordanm has joined #ruby
04:34
apeiros has quit [Ping timeout: 240 seconds]
04:37
ta_ has joined #ruby
04:49
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
04:56
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
04:57
MoritaShinobu has joined #ruby
04:57
apeiros has joined #ruby
04:58
elphe has quit [Ping timeout: 252 seconds]
05:02
apeiros has quit [Ping timeout: 272 seconds]
05:08
elphe has joined #ruby
05:08
postmodern has joined #ruby
05:09
ta_ has quit [Ping timeout: 264 seconds]
05:12
mochiyoda has joined #ruby
05:16
xuanrui has quit [Remote host closed the connection]
05:29
mikecmpbll has quit [Quit: inabit. zz.]
05:36
apeiros has joined #ruby
05:39
mochiyoda has quit [Quit: Konversation terminated!]
05:41
apeiros has quit [Ping timeout: 264 seconds]
05:49
arescorpio has joined #ruby
05:55
noobineer has quit [Ping timeout: 240 seconds]
05:56
djellemah has quit [Read error: Connection reset by peer]
05:56
djellemah has joined #ruby
05:58
eb0t has joined #ruby
05:58
def_jam has joined #ruby
05:59
eb0t_ has quit [Ping timeout: 245 seconds]
06:00
eblip has quit [Ping timeout: 252 seconds]
06:01
noobineer has joined #ruby
06:03
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
06:11
apeiros has joined #ruby
06:15
apeiros has quit [Ping timeout: 246 seconds]
06:16
reber has joined #ruby
06:21
<
nchambers >
is there a method like Array::collect except doesn't include nil entries
06:23
<
nchambers >
ah, .compact
06:23
<
baweaver >
Array#collect technically, though Array#map is more common.
06:23
<
baweaver >
map compact is used fairly frequently.
06:24
dellavg_ has joined #ruby
06:26
n13z_ has quit [Quit: leaving]
06:33
noodle has quit [Quit: /quit]
06:34
noodle has joined #ruby
06:40
rippa has joined #ruby
06:42
TheBloke has quit [Read error: Connection reset by peer]
06:43
apeiros has joined #ruby
06:44
arescorpio has quit [Quit: Leaving.]
06:45
TheBloke has joined #ruby
06:47
apeiros has quit [Ping timeout: 240 seconds]
07:06
_whitelogger has joined #ruby
07:07
ta_ has joined #ruby
07:14
whysthatso has joined #ruby
07:15
apeiros has joined #ruby
07:20
apeiros has quit [Ping timeout: 252 seconds]
07:40
ta_ has quit [Ping timeout: 250 seconds]
07:51
apeiros has joined #ruby
07:52
phaul has joined #ruby
07:55
apeiros has quit [Ping timeout: 246 seconds]
07:58
armyriad has quit [Quit: Leaving]
08:07
anubhav996 has joined #ruby
08:10
ta_ has joined #ruby
08:24
apeiros has joined #ruby
08:24
n13z has joined #ruby
08:26
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
08:26
armyriad has joined #ruby
08:27
Emmanuel_Chanel has joined #ruby
08:28
apeiros has quit [Ping timeout: 246 seconds]
08:31
lypsis has joined #ruby
08:44
def_jam is now known as eblip
08:46
postmodern has quit [Quit: Leaving]
08:46
conta has joined #ruby
08:49
apparition has joined #ruby
08:57
voolik has joined #ruby
08:58
cd has quit [Quit: cd]
09:03
Wojnar has joined #ruby
09:23
apeiros has joined #ruby
09:28
mikecmpbll has joined #ruby
09:54
xfbs has joined #ruby
09:58
doubledup has joined #ruby
09:58
doubledup has quit [Client Quit]
10:11
djellemah has quit [Remote host closed the connection]
10:12
cabotto has joined #ruby
10:14
mikecmpbll has quit [Quit: inabit. zz.]
10:23
elphe has quit [Quit: leaving]
10:25
ohcibi_ has quit [Remote host closed the connection]
10:27
anubhav996 has quit [Quit: Connection closed for inactivity]
10:28
ohcibi has joined #ruby
10:30
TheBloke has quit [Read error: Connection reset by peer]
10:31
TheBloke has joined #ruby
10:34
venmx has joined #ruby
10:39
AJA4350 has joined #ruby
10:40
cabotto has quit []
10:40
nezt0r has joined #ruby
10:42
AJA4350 has quit [Client Quit]
10:43
AJA4350 has joined #ruby
10:47
jottr has joined #ruby
10:49
Wojnar has quit [Remote host closed the connection]
10:54
TheBloke has quit [Read error: Connection reset by peer]
10:56
TheBloke has joined #ruby
11:17
voolik has quit [Quit: Taking a nap...]
11:21
bkxd has joined #ruby
11:26
bier has joined #ruby
11:29
whysthatso has left #ruby [#ruby]
11:29
whysthatso has joined #ruby
11:31
jottr has quit [Ping timeout: 240 seconds]
11:31
Nicmavr has quit [Read error: Connection reset by peer]
11:32
aufi has joined #ruby
11:33
conta has quit [Quit: conta]
11:33
Nicmavr has joined #ruby
11:46
whysthatso has quit [Quit: whysthatso]
11:46
whysthatso has joined #ruby
11:47
bkxd has quit [Ping timeout: 246 seconds]
11:51
Dimik has joined #ruby
11:51
Dimik has quit [Excess Flood]
11:51
sidx64 has joined #ruby
11:52
Dimik has joined #ruby
11:52
Dimik has quit [Excess Flood]
11:58
yokel has quit [Remote host closed the connection]
12:00
yokel has joined #ruby
12:02
DTZUZO has quit [Ping timeout: 246 seconds]
12:12
jottr has joined #ruby
12:18
ujjain has quit [Ping timeout: 240 seconds]
12:24
bmurt has joined #ruby
12:25
cyclonis has joined #ruby
12:27
phaul has quit [Ping timeout: 240 seconds]
12:30
kapil____ has joined #ruby
12:31
bkxd has joined #ruby
12:33
voolik has joined #ruby
12:36
bkxd has quit [Read error: Connection reset by peer]
12:40
voolik has quit [Ping timeout: 276 seconds]
12:41
c0ncealed4 has quit [Remote host closed the connection]
12:42
c0ncealed4 has joined #ruby
12:46
sidx64 has quit [Ping timeout: 252 seconds]
12:47
bkxd has joined #ruby
12:51
venmx has quit [Ping timeout: 240 seconds]
12:53
<
apeiros >
moin cyclonis
12:59
apeiros has quit [Read error: Connection reset by peer]
13:00
apeiros has joined #ruby
13:04
bkxd has quit [Read error: Connection reset by peer]
13:04
Wojnar has joined #ruby
13:12
apeiros has quit [Read error: Connection reset by peer]
13:12
phaul has joined #ruby
13:12
apeiros has joined #ruby
13:29
apeiros has quit [Read error: Connection reset by peer]
13:30
apeiros has joined #ruby
13:31
bkxd has joined #ruby
13:34
thebetrayer has quit [Read error: No route to host]
13:34
thebetrayer has joined #ruby
13:36
bkxd has quit [Read error: Connection reset by peer]
13:42
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:49
conta has joined #ruby
13:52
GodFather has joined #ruby
13:53
bkxd has joined #ruby
13:53
samort7 has joined #ruby
14:00
leitz has joined #ruby
14:09
bkxd has quit [Read error: Connection reset by peer]
14:09
rubydoc has quit [Remote host closed the connection]
14:10
rubydoc has joined #ruby
14:13
noark9 has joined #ruby
14:14
despai has joined #ruby
14:14
bkxd has joined #ruby
14:19
_whitelogger has joined #ruby
14:19
Wojnar has quit [Remote host closed the connection]
14:21
Wojnar has joined #ruby
14:23
bkxd has quit [Read error: Connection reset by peer]
14:29
venmx has joined #ruby
14:30
TheBloke has quit [Read error: Connection reset by peer]
14:31
queip has joined #ruby
14:32
DTZUZO has joined #ruby
14:33
knight33 has joined #ruby
14:36
DTZUZO has quit [Ping timeout: 240 seconds]
14:37
voolik has joined #ruby
14:38
im0nde has joined #ruby
14:38
asphyxia has quit [Ping timeout: 244 seconds]
14:39
roshanavand has joined #ruby
14:40
bkxd has joined #ruby
14:43
phaul has quit [Read error: Connection reset by peer]
14:44
Inline has quit [Quit: Leaving]
14:44
phaul has joined #ruby
14:49
Wojnar has quit [Remote host closed the connection]
14:49
mikecmpbll has joined #ruby
14:49
djellemah has joined #ruby
14:50
houhoulis has joined #ruby
14:51
bkxd has quit [Ping timeout: 246 seconds]
14:51
despai has quit [Quit: ...]
15:00
Dimik has joined #ruby
15:00
Dimik has quit [Excess Flood]
15:00
Dimik has joined #ruby
15:00
Dimik has quit [Excess Flood]
15:03
apparition has quit [Quit: Bye]
15:04
samort7 has quit [Read error: Connection reset by peer]
15:04
conta has quit [Quit: conta]
15:15
venmx has quit [Ping timeout: 272 seconds]
15:24
bkxd has joined #ruby
15:32
johnny56 has quit [Ping timeout: 272 seconds]
15:35
_whitelogger has joined #ruby
15:38
Wojnar has joined #ruby
15:40
bkxd has quit [Read error: Connection reset by peer]
15:42
cow[moo] has joined #ruby
15:46
zapata has quit [Read error: Connection reset by peer]
15:46
cow[moo] has quit [Client Quit]
15:47
zapata has joined #ruby
15:47
cow[moo] has joined #ruby
15:48
c0ncealed4 has quit [Remote host closed the connection]
15:49
c0ncealed4 has joined #ruby
15:50
dviola has joined #ruby
15:57
bkxd has joined #ruby
15:59
orbyt_ has joined #ruby
16:00
k0mpa has quit [Ping timeout: 256 seconds]
16:00
whysthatso has quit [Quit: whysthatso]
16:01
whysthatso has joined #ruby
16:07
Inline has joined #ruby
16:09
MiLLiYEtCHi has quit []
16:09
noark9 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
16:11
bkxd has quit [Ping timeout: 245 seconds]
16:13
noark9 has joined #ruby
16:21
whysthatso has quit [Remote host closed the connection]
16:21
whysthatso has joined #ruby
16:22
noark9 has joined #ruby
16:25
MoritaShinobu has quit [Quit: Leaving]
16:34
johnny56 has joined #ruby
16:37
dviola has quit [Quit: WeeChat 2.3]
16:39
conta has joined #ruby
16:40
akem__ has joined #ruby
16:41
nicholaslyang has joined #ruby
16:41
akem has quit [Ping timeout: 272 seconds]
16:42
dviola has joined #ruby
16:43
c0ncealed4 has quit [Remote host closed the connection]
16:44
c0ncealed4 has joined #ruby
16:45
bkxd has joined #ruby
16:50
bkxd has quit [Read error: Connection reset by peer]
16:50
bkxd has joined #ruby
16:52
noark9 has quit [Quit: noark9]
16:53
eddof13 has joined #ruby
16:54
gh0sh- has joined #ruby
16:55
eddof13 has quit [Client Quit]
16:55
bkxd has quit [Read error: Connection reset by peer]
16:58
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:01
bak1an has joined #ruby
17:04
bak1an has quit [Client Quit]
17:06
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
17:09
noark9 has joined #ruby
17:12
dviola has quit [Quit: WeeChat 2.3]
17:17
bkxd has joined #ruby
17:20
aufi has quit [Ping timeout: 244 seconds]
17:24
bkxd has quit [Read error: Connection reset by peer]
17:28
dviola has joined #ruby
17:29
kapil____ has quit [Quit: Connection closed for inactivity]
17:31
Dimik has joined #ruby
17:31
Dimik has quit [Excess Flood]
17:34
roshanavand has quit [Quit: leaving]
17:44
noark9 has quit [Quit: noark9]
17:45
noobineer has quit [Ping timeout: 252 seconds]
17:46
bkxd has joined #ruby
17:52
kapil____ has joined #ruby
17:56
voolik has quit [Quit: Leaving]
17:56
rubydoc has quit [Remote host closed the connection]
17:58
orbyt_ has quit [Read error: Connection reset by peer]
17:58
fusta has joined #ruby
17:59
cd has joined #ruby
18:02
knight33 has joined #ruby
18:02
Wojnar has quit [Remote host closed the connection]
18:03
rubydoc has joined #ruby
18:03
bkxd has quit [Ping timeout: 245 seconds]
18:04
raulp has quit [Ping timeout: 264 seconds]
18:04
crankharder has joined #ruby
18:09
eddof13 has joined #ruby
18:14
eddof13 has quit [Ping timeout: 252 seconds]
18:16
orbyt_ has joined #ruby
18:18
kaleido has joined #ruby
18:20
bkxd has joined #ruby
18:25
bkxd has quit [Read error: Connection reset by peer]
18:26
bak1an has joined #ruby
18:31
bak1an has quit [Ping timeout: 250 seconds]
18:31
bkxd has joined #ruby
18:33
Puffball has quit [Remote host closed the connection]
18:33
Puffball has joined #ruby
18:35
bkxd has quit [Read error: Connection reset by peer]
18:37
mistergibson has quit [Quit: Leaving]
18:37
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
18:38
nexraf1 has joined #ruby
18:41
bkxd has joined #ruby
18:43
crankharder has quit [Ping timeout: 245 seconds]
18:44
apeiros has quit [Read error: Connection reset by peer]
18:45
apeiros has joined #ruby
18:46
rubydoc has quit [Remote host closed the connection]
18:53
bkxd has quit [Ping timeout: 252 seconds]
18:54
jottr has quit [Ping timeout: 244 seconds]
18:59
jottr has joined #ruby
18:59
bkxd has joined #ruby
19:02
xfbs has quit [Quit: afk]
19:03
xfbs has joined #ruby
19:05
bkxd has quit [Read error: Connection reset by peer]
19:10
bkxd has joined #ruby
19:13
Wojnar has joined #ruby
19:16
bkxd has quit [Read error: Connection reset by peer]
19:16
jottr has quit [Ping timeout: 240 seconds]
19:18
jottr has joined #ruby
19:23
leitz has quit [Quit: Leaving]
19:24
Freshnuts has joined #ruby
19:27
bkxd has joined #ruby
19:30
rubydoc has joined #ruby
19:33
uplime has joined #ruby
19:34
nchambers has quit [Ping timeout: 264 seconds]
19:35
Azure has quit [Ping timeout: 246 seconds]
19:35
Azure has joined #ruby
19:38
bkxd has quit [Read error: Connection reset by peer]
19:44
ta_ has quit [Quit: Leaving...]
19:49
whysthatso_ has joined #ruby
19:51
whysthatso has quit [Ping timeout: 250 seconds]
19:51
whysthatso_ is now known as whysthatso
19:55
Fusl has quit [Ping timeout: 256 seconds]
19:55
conta has quit [Quit: conta]
20:00
Fusl has joined #ruby
20:06
SCHAPiE has joined #ruby
20:11
bkxd has joined #ruby
20:12
<
i8igmac >
how can i regex from a capitle letter to a peried
20:12
<
i8igmac >
data.scan(/[A-Z].*\./)
20:12
<
canton7 >
is "to regex" a verb now?
20:12
<
i8igmac >
"Start and end of a sentence."
20:13
<
canton7 >
oh, so you want to start with a capital letter, followed by a number of other things, and finally a period?
20:13
<
i8igmac >
"So what. Lets talk about it.".scan(/[A-Z]*\./)
20:14
<
i8igmac >
pulling sentences from large paragraphs
20:14
<
canton7 >
so, you want
*one* [A-Z], then
*zero or more* other things, then
*one* period
20:14
<
canton7 >
your regex is *zero or more [A-Z], then one period
20:14
jacobherrington has joined #ruby
20:15
<
i8igmac >
must have 1 capital letter to start and end with a period
20:16
<
canton7 >
yes, you said that
20:16
<
canton7 >
so to step through my sentence above, do you know the regex for "one capital letter"?
20:17
jottr has quit [Ping timeout: 246 seconds]
20:17
bkxd has quit [Read error: Connection reset by peer]
20:22
bkxd has joined #ruby
20:23
<
i8igmac >
i keep trying but i dont know
20:23
<
i8igmac >
scan(/[A-Z]{1}/)
20:23
<
i8igmac >
scan(/[^A-Z]{1}/)
20:23
<
canton7 >
Right, or just [A-Z]
20:23
<
canton7 >
that's the first capital letter
20:23
<
canton7 >
do you know what the regex for "any letter, zero or more times" is?
20:24
<
i8igmac >
* <-lol i suck at thisd
20:24
<
canton7 >
that means "zero or more times" yes, but you're missing the "any letter" bit
20:27
<
i8igmac >
(^.*?) maybe
20:27
bkxd has quit [Read error: Connection reset by peer]
20:28
<
canton7 >
"^" means "the beginning of the string", so you probably don't want that in there
20:28
<
canton7 >
(or the beginning of the line, before someone corrects me)
20:28
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:28
<
canton7 >
"." means "any character"
20:30
<
canton7 >
and you've already got "a period exactly one time" in your original regex
20:30
<
canton7 >
so if you put it all together, you're almost there...
20:33
bkxd has joined #ruby
20:35
tdy has quit [Ping timeout: 240 seconds]
20:35
Wojnar has quit [Ping timeout: 246 seconds]
20:35
thebetrayer has quit [Ping timeout: 250 seconds]
20:36
dellavg_ has quit [Ping timeout: 252 seconds]
20:37
bkxd has quit [Read error: Connection reset by peer]
20:38
bkxd has joined #ruby
20:40
<
apeiros >
i8igmac: solved your problem?
20:40
<
canton7 >
(there's one final step, which is to stop it matching two sentences together as one match)
20:42
<
apeiros >
>> "So what? Lets talk\nabout it.".scan(/\p{Upper}[^.!?]*[.!?]/)
20:42
<
ruby[bot] >
apeiros: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
20:42
<
apeiros >
well, phaul did rewrite it to use carc. I should get that PR released.
20:42
jottr has joined #ruby
20:42
<
apeiros >
> "So what? Lets talk\nabout it.".scan(/\p{Upper}[^.!?]*[.!?]/) # => ["So what?", "Lets talk\nabout it."]
20:43
tdy has joined #ruby
20:43
<
apeiros >
I'm not sure using uppercase as an anchor for "beginning of sentence" is a good idea, though. also depending on what it's used on, things like quotation marks should be considered.
20:43
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
20:44
<
apeiros >
and not every dot is the end of a phrase, e.g. those dots just there aren't.
20:44
jacobherrington has quit [Quit: WeeChat 2.2]
20:44
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:44
<
canton7 >
I rather suspect this is a very hard problem for the general case :P
20:46
<
apeiros >
> "So what? Lets talk\nabout e.g. these funny stories.".scan(/\p{Upper}(?:\b\p{L}\.|[^.!?])*[.!?]/) # => ["So what?", "Lets talk\nabout e.g. these funny stories."]
20:46
<
apeiros >
the hardest part is to predict all cases
20:46
<
apeiros >
and there might some cases you simply can't handle with raw regex.
20:46
<
canton7 >
yeah, I was thinking that grammar is distinctly non-regulay
20:47
<
canton7 >
*non-regular
20:47
<
apeiros >
regulay sounds cromulent.
20:48
jottr has quit [Ping timeout: 246 seconds]
20:48
tdy1 has joined #ruby
20:50
bkxd has quit [Read error: Connection reset by peer]
20:51
tdy has quit [Ping timeout: 264 seconds]
20:55
Inside has quit [Disconnected by services]
20:59
kapil____ has quit [Quit: Connection closed for inactivity]
21:02
bkxd has joined #ruby
21:06
kurko_ has joined #ruby
21:07
bkxd has quit [Read error: Connection reset by peer]
21:11
whysthatso has quit [Quit: whysthatso]
21:14
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:16
tdy1 has quit [Ping timeout: 252 seconds]
21:19
houhoulis has quit [Remote host closed the connection]
21:20
tdy1 has joined #ruby
21:23
bkxd has joined #ruby
21:24
phaul has quit [Ping timeout: 246 seconds]
21:27
kurko_ has joined #ruby
21:29
tdy1 has quit [Ping timeout: 245 seconds]
21:29
tdy2 has joined #ruby
21:29
bkxd has quit [Read error: Connection reset by peer]
21:31
Wojnar has joined #ruby
21:34
TheBloke has joined #ruby
21:34
bkxd has joined #ruby
21:35
tdy3 has joined #ruby
21:37
tdy2 has quit [Ping timeout: 246 seconds]
21:38
bkxd has quit [Read error: Connection reset by peer]
21:38
akem has joined #ruby
21:39
tdy3 has quit [Ping timeout: 246 seconds]
21:41
akem__ has quit [Ping timeout: 252 seconds]
21:45
Wojnar has quit [Remote host closed the connection]
21:46
tdy3 has joined #ruby
21:52
nexraf1 has quit [Ping timeout: 264 seconds]
21:54
TheBloke has quit [Read error: No route to host]
21:55
lightstalker has quit [Ping timeout: 246 seconds]
21:56
TheBloke has joined #ruby
22:01
lightstalker has joined #ruby
22:02
bkxd has joined #ruby
22:08
rubydoc has quit [Remote host closed the connection]
22:11
Nicmavr has quit [Read error: Connection reset by peer]
22:11
mikecmpbll has quit [Quit: inabit. zz.]
22:13
Nicmavr has joined #ruby
22:16
rubydoc has joined #ruby
22:17
bkxd has quit [Read error: Connection reset by peer]
22:22
nadir has joined #ruby
22:27
i8igmac has quit [Read error: Connection reset by peer]
22:28
DTZUZO has joined #ruby
22:28
bkxd has joined #ruby
22:30
tdy3 has quit [Ping timeout: 264 seconds]
22:39
reber has quit [Remote host closed the connection]
22:41
d^sh has quit [Ping timeout: 252 seconds]
22:41
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
22:43
d^sh has joined #ruby
22:46
bkxd has quit [Quit: Lost terminal]
22:50
tdy3 has joined #ruby
22:53
venmx has joined #ruby
22:53
RedNifre has joined #ruby
22:54
<
RedNifre >
Hey there.
22:55
cow[moo] has joined #ruby
22:55
<
RedNifre >
I'm trying to write a very simple event system so I do `require 'observer'`, I defined some events as structs i.e. Event_a = Struct.new(:bla), Event_b = Struct.new(:bleh) etc. and I successfully emit them with `changed; notify_observers(event)`, which works, but how do I figure out which event I received?
22:56
<
RedNifre >
Conceptiually, I might have problems because I'm used to statically typed languages.
22:57
<
RedNifre >
I guess Struct.new creates a new class and the observer would have to do something like `when(event.class) case Event_a` or something?
22:57
<
RedNifre >
Writing a switch case for the class? Or am I on the wrong track here?
22:57
tdy3 has quit [Ping timeout: 245 seconds]
22:58
bmurt has joined #ruby
22:59
<
apeiros >
Struct.new indeed returns a class
23:00
<
apeiros >
but `case event.class when EventA` won't work. you have to use `case event when EventA` (and please, don't call them Event_a, call them EventA, ruby convention is pascal case for this)
23:00
<
RedNifre >
Basically, I'm asking because I want to prevent me writing some crazy code, not knowing how to do it properly.
23:02
<
apeiros >
looking at the docs of observable, it doesn't provide any concepts for message type. so that's up to you.
23:02
<
RedNifre >
Alright, I changed it, I guess I was thinking about variables...
23:02
<
apeiros >
you can do it via the class of the event data, or by a separate parameter - entirely up to you.
23:02
<
apeiros >
*it doesn't +seem+ to…
23:03
<
RedNifre >
Well, doing it via the class of the event data seems natural to me, kinda like an enum or adt.
23:03
<
apeiros >
(I've just glanced over the docs, so I might have missed stuff)
23:03
<
apeiros >
I'd probably rather go via a property of the event, making it more flexible. but as said, it seems to be up to you.
23:03
jottr has joined #ruby
23:04
<
RedNifre >
Right now, the structs are on the top level of a .rb file. Can I put them in a group like an enum or ADT?
23:05
<
RedNifre >
(hm... not sure if that would actually acomplish anything...)
23:06
<
RedNifre >
Algebraic data type
23:06
<
RedNifre >
Like, it's the same type but different constructors yielding different things.
23:07
<
apeiros >
ruby doesn't have enum or adts out of the box. you can construct similarly working things, though.
23:07
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:07
<
apeiros >
and while ruby doesn't have constructors, you can have class methods which do a bit of stuff for you.
23:07
<
RedNifre >
For example type Response = OK | Fail(reason: String), where the OK object has no slots, but the Fail instance has one.
23:07
<
RedNifre >
Well, I think it might not help anyways.
23:08
<
apeiros >
ruby is dynamically typed. so you can't enforce something like this in that way.
23:09
<
apeiros >
so the question is - what properties are you looking for?
23:10
<
RedNifre >
It should communicate to the reader that these structs form some group.
23:10
<
apeiros >
would a namespace serve that purpose?
23:10
venmx has quit [Ping timeout: 252 seconds]
23:11
<
RedNifre >
how would that look like?
23:12
<
RedNifre >
just module Evenet \ EventA = Struct.new... ?
23:13
<
apeiros >
you can use ; to indicate newlines. that's got the benefit of being even valid.
23:13
<
apeiros >
and yes. that's how it'd look like.
23:13
<
RedNifre >
oh, right :)
23:13
<
RedNifre >
Excellent.
23:14
<
apeiros >
and you can always do; module Evenet; …your structs…; def self.all; [EventA, EventB, …]; end; end`
23:14
<
apeiros >
so Evenet.all will yield a list with all event classes
23:14
<
apeiros >
(though I'd probably require 'set' and return a frozen set)
23:24
akem has quit [Quit: Leaving]
23:27
<
RedNifre >
Hm... it's not `module LogEvent; A = Struct.new(...) end ; LogEvent.A.new(...), is it? I'm getting "undefined method `A' for LogEvent:Module" then...
23:29
<
RedNifre >
I meant LogEvent::A.new(...)
23:29
<
RedNifre >
...or should it be even LogEvent::A::new? Probably not... is "." for methods and "::" for variables? How exactly does :: work?
23:32
tdy3 has joined #ruby
23:32
orbyt_ has joined #ruby
23:37
dviola has quit [Quit: WeeChat 2.3]
23:40
Wojnar has joined #ruby
23:50
nexraf1 has joined #ruby
23:52
kurko_ has joined #ruby
23:54
Freshnuts has quit [Quit: Leaving]