taw / magic-search-engine

Search engine for Magic cards
MIT License
43 stars 20 forks source link

Related card logic #273

Closed pyyhttu closed 9 months ago

pyyhttu commented 9 months ago

I guess there is some logic (#23) to related card feature, but can you @taw open it up a little?

Asking, since I see e.g. Smoke linking with related card to Smoke Spirits' Aid?

taw commented 9 months ago

The system is mostly a big regular expression for "named <card1|card2|...|cardN>" with names of all printed cards.

Smoke Spirits' Aid contains text "named Smoke", and Smoke is a card, so it matches.

Now what the card actually says is "named Smoke Blessing" and if "Smoke Blessing" was a card name, it would match it instead, but it's not.

Sometimes tokens and cards share a name, see for example Llanowar Elves.

I can fix Smoke case. If you see other questionable matches, let me know.

Code for it is mostly in indexer/lib/patches/patch_link_related.rb

taw commented 9 months ago

I added Smoke Blessing to exceptions list.

Let me know if there are any other matches that are either missing, or wrong.

pyyhttu commented 9 months ago

Thanks. Now that related card concept is clear, can also report deviations better, should I bump into them.