dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.1.0
Azure has joined #cinch
postmodern has quit [Quit: Leaving]
postmodern has joined #cinch
snapcase has quit [Ping timeout: 245 seconds]
snapcase has joined #cinch
heru has joined #cinch
searcher has joined #cinch
heru has quit [Remote host closed the connection]
heru has joined #cinch
searcher has quit [Remote host closed the connection]
heru has quit [Ping timeout: 252 seconds]
nkr has quit [Quit: Linkinus - http://linkinus.com]
emonakhova has joined #cinch
rikai has quit [Ping timeout: 255 seconds]
rikai has joined #cinch
rikai has joined #cinch
emonakhova has quit [Remote host closed the connection]
heru has joined #cinch
heru has quit [Ping timeout: 252 seconds]
heru has joined #cinch
heru has quit [Ping timeout: 240 seconds]
<rails> gonna teach gf ruby
<rails> wish meluck
<dominikh> gl, fool
postmodern has quit [Quit: Leaving]
<catepillar> lol
heru has joined #cinch
nkr has joined #cinch
Azure is now known as __END__
<CM-Punk> Okay, if I have a matcher that provides arguments for a category that could be up to two words, and terms that could be an unspecified number of words...what would it look like?
<onewheelskyward> Is the word separator always a space?
<leftylink> but wait. if I have a b c, is the category "a b" and the term "c", or the category "a" and term "b c"?
<leftylink> how are you resolving the ambiguity, basically, is my question
<CM-Punk> That would be where I'm stuck, leftylink
<onewheelskyward> Categories are known.
<leftylink> well that's a decision you have to make
<onewheelskyward> I'd pull in all the variables and check the first two for category status.
<onewheelskyward> If categories and terms overlap, I'd rethink the taxonomy.
<leftylink> sounds reasonable
<onewheelskyward> Or perhaps perform both searches, depending on the data set.
<CM-Punk> Like
<CM-Punk> It's a huge list
<onewheelskyward> that's huge?
<onewheelskyward> There's like 30 of them
<CM-Punk> Especially when you add the subcategories, used in a later function
<onewheelskyward> ah, that could get big.
<CM-Punk> overall yeah
<onewheelskyward> I'd bet, though, that you'll find there isn't a lot of overlap and the first thing that doesn't match a sub cat is a term.
<onewheelskyward> For instance, I'm not going to search sports baseball for baseball
<CM-Punk> Right
<onewheelskyward> And if I did I'd be right to get spammed with everything. :)
<onewheelskyward> Or, "There are 25,435 results for baseball. Would you like to clarify?"
<CM-Punk> Well
<CM-Punk> I just had another thought
<CM-Punk> If I add a -
<CM-Punk> Like ~n-search Sports-Baseball Babe Ruth
<onewheelskyward> That's a little clunky for the user.
<onewheelskyward> But would likely work.
<CM-Punk> Yeah, it is :(
<onewheelskyward> The known category route seems straightforward to implement.
<CM-Punk> But I'd have no idea how to code that :/
<onewheelskyward> Is that json where you're pulling the categories from?
<CM-Punk> Yeah
<onewheelskyward> You can read through that, push the categories into an array and then use array.include? category
<CM-Punk> I mean picking it out of the regex
<CM-Punk> I already do what you're talking about
<leftylink> the two options are having the regex groups be word 1, word 2, and all other words
<leftylink> the second option is capturing all in one group
<leftylink> and doing the word split yourself
<leftylink> the approaches aren't really that different I guess
<onewheelskyward> Given that it's n words and the second's purpose is ambiguous, I'd go with group capture.
<onewheelskyward> Or perhaps word + word group
<CM-Punk> Thanks for the suggestions guys
<CM-Punk> It helps
<CM-Punk> One of my users suggested
<CM-Punk> ~news Top News.Entertainment
<CM-Punk> Like that
<CM-Punk> where the subcategory is optional
<CM-Punk> If I did (.+).(optional) (.+)
<CM-Punk> I don't remember how to do optional
<CM-Punk> but would that work?
<Rylee> (.+)(\..*) is perhaps what you are looking for
<Rylee> (.+)(\..*)? is perhaps what you are looking for
<Rylee> *
irsol has quit [Ping timeout: 252 seconds]
<CM-Punk> Oh? How does that work Rylee? I'm a regex dumbass
irsol has joined #cinch
<Rylee> .+ matches one or more characters, .* matches 0 or more, \. is the escaped period, and the ? at the end of (\..*) makes it optional
<CM-Punk> Ohhhh
<CM-Punk> Thanks
<CM-Punk> Can you put a method in a matcher?
<catepillar> what do you mean?
<catepillar> i think the answer is no, but im not sure what you want to do...
<CM-Punk> Like
<CM-Punk> I know if you put (foo|bar|you) into regex it will match whatever one is there
<CM-Punk> If I can push the output of the categories into that format can I feed it into the matcher?
<catepillar> what's your matcher look like right now? you can have it have arguments passed in
<catepillar> and i think taht's what you want
<CM-Punk> It looks like nothing
<CM-Punk> I'm trying to organize it
<CM-Punk> here
<catepillar> the on :message block with a /^!join (.+)/ regex
<catepillar> will match a function with a definition like `def function(m, matched_text)`
deb is now known as SSbroker
<CM-Punk> http://pastie.org/private/luosvapcnbfcdwqm9ltpa here's my plugin catepillar
<CM-Punk> I need to be able to allow users to search by category, or category and subcategory and some of the categories and subcategories are multiple words
<leftylink> just curious-- is the set of categories expected to stay constant? if not, how frequently changing? what is the story here
<leftylink> depending on the answer, some different things may be necessary
<leftylink> if known unchanging, basically can build the regex at bot-start-time
<leftylink> instead of dynamically at match-time
<CM-Punk> It's changed recently, so other than that I don't know the answer to that question
<CM-Punk> So like, with the function at line 28, if I change the join to "|" could I pass that into the matcher regex?
aclearman037 has joined #cinch
aclearman037 has quit [Client Quit]
postmodern has joined #cinch
nkr has quit [Quit: Linkinus - http://linkinus.com]
postmodern has quit [Remote host closed the connection]
heru has quit [Remote host closed the connection]
heru has joined #cinch
postmodern has joined #cinch
heru has quit [Ping timeout: 240 seconds]
heru has joined #cinch
heru has quit [Ping timeout: 255 seconds]