The only time you consult with someone is when you're seeking advice from a person (not a book or internet article), and you're looking for general information. Any time you say "consult with", you can use "consult" instead. Using "consult" sounds more direct, which is why it's used when you're looking for very specific information. Here're a few examples:
I should consult with my lawyer before I decide whether or not to buy this house
You're looking for general information, as you don't have a specific question about the house that will convince you to buy it or not.
After I consult my lawyer to see if I have a case, I will take you to court!
You are asking your lawyer "do I have a case if this happened", which means you're looking for specific information
I can't think of any words that begin with X, let me consult a dictionary
You're looking for general information, but it's not from a person. You would never consult with a dictionary because that sounds like you'd have a conversation with it.
Please consult with your doctor before you worry too much about that infection
The infection could be anything, so you're consulting with your doctor (general information). If you thought it might be malaria, you'd consult your doctor (specific information).
Consult your doctor if there are any immediate side affects
This sounds like you're asking for general information (I have side effects, what does that mean?) but saying consult instead of consult with sounds more direct and urgent. This is an order, "consult your doctor now!" instead of "consult with your doctor the next time you see him".
Hope that makes things clearer!
I would be inclined to go the more direct route:
... where c1 and c2 are the terms whose similarity the system is trying to find.
This structure keeps the emphasis on the terms and eliminates the dangling preposition.
Per @ColleenV, please note that while "whose" is typically used to refer to an animate object, English does not have an inanimate pronoun to handle this situation, so "whose" is correct.
Best Answer
I believe the author is trying to say that the main character thought (without letting it be known to others, i.e., to herself) the following: “Unless you try to talk to guys, genius.”
This could be made clearer by writing it with quotation marks, like so: