It is currently 26 Apr 2024, 01:29
   
Text Size

Autocard question

Discuss anything concerning this site and its contents

Moderator: CCGHQ Admins

Autocard question

Postby Aswan jaguar » 04 Oct 2013, 18:18

Is there a way for autocard to show special characters,flipped cards,double faced etc...
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: Autocard question

Postby Korath » 22 Mar 2014, 13:23

I'll echo this. Split (Fire // Ice), flippable (Nezumi Graverobber // Nighteyes the Desecrator), and double-faced cards (Chalice of Life // Chalice of Death) haven't worked since I started paying attention here. I seem to recall that cards with accents used to work if you translated them to the equivalent ascii, e.g. Oath of Lim-Dûl to Oath of Lim-Dul or Juzám Djinn to Juzam Djinn, but they definitely don't now.

Plus, matching at the start of a post is a bit wonky. If a post starts with a card name (Lightning Axe), it won't be highlit; if it starts with a letter then a card name with no space in between (aLightning Axe), the card will be improperly highlit; and if a post starts with either "A " or "a ", then no cards anywhere in the post will be highlit. Symptoms seem to match a "\a" in the regex not being properly escaped.
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: Autocard question

Postby Huggybaby » 24 Mar 2014, 17:35

Goblin Hero wrote the autocard software, you could send him a PM.
User avatar
Huggybaby
Administrator
 
Posts: 3207
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 701 times
Been thanked: 594 times

Re: Autocard question

Postby Korath » 14 Apr 2014, 00:27

Goblin Hero's sent me the source and data, and I've started poking at it. Split/flippable/double-faced cards turned out to be easy, and I've sent him a fix.

Other issues (which I mostly haven't even begun to investigate):
  1. Start of post "A " and "a " disables all matching.
  2. Card name at the very start of a post isn't matched.
  3. A card name starting in the second character of a post is matched, even if it's not at a word boundary.
  4. Card names with apostrophes aren't matched within spoiler tags. (I won't be able to debug this directly.) Test case: Giant Growth Gaea's Liege
    both should match within | Open
    Giant Growth Gaea's Liege
  5. Cards with any but a few non-alphabetic characters don't get matched. SELECT name FROM oracle WHERE name NOT RLIKE '^[A-Z][A-Za-z ,'':|-]*[A-Za-z'']$'; gives me:
    Unhighlit cards | Open
    1996 World Champion
    B.F.M.
    Borrowing 100,000 Arrows
    Bösium Strip
    Chicken à la King
    Dandân
    Denied!
    Déjà Vu
    El-Hajjâj
    Erase (Not the Urza's Legacy One)
    Framed!
    Ghazbán Ogre
    Ghazbán Ogress
    Goblin S.W.A.T. Team
    Guan Yu's 1,000-Li March
    Ifh-Bíff Efreet
    Incoming!
    Junún Efreet
    Juzám Djinn
    Jötun Grunt
    Jötun Owl Keeper
    Kaboom!
    Khabál Ghoul
    Kill! Destroy!
    Kongming, "Sleeping Dragon"
    Land Aid '04
    Legions of Lim-Dûl
    Lim-Dûl the Necromancer
    Lim-Dûl's Cohort
    Lim-Dûl's Hex
    Lim-Dûl's High Guard
    Lim-Dûl's Paladin
    Lim-Dûl's Vault
    Look at Me, I'm R&D
    Mine, Mine, Mine!
    Márton Stromgald
    Oath of Lim-Dûl
    Pang Tong, "Young Phoenix"
    Question Elemental?
    R&D's Secret Lair
    Richard Garfield, Ph.D.
    Ring of Ma'rûf
    S.N.O.T.
    Sarpadian Empires, Vol. VII
    Sauté
    Séance
    The Ultimate Nightmare of Wizards of the Coast® Customer Service
    To Arms!
    _____
    "Ach! Hans, Run!"
    (Those match up exactly to what I'm seeing from comprehensive tests against the supplied data, except that Look at Me, I'm R&D and R&D's Secret Lair work locally; I suspect their problem on-site - besides that they have apostrophes and are within a spoiler tag above, per bug #4 - is early expansion of the ampersand to &.) I don't anticipate any problem with matching accents, except perhaps at the start or end of a card name. Most of the remainder seem to be from unsets, so I'm less concerned with them.
  6. Cards with commas in their names don't highlight if preceded by a capitalized word (Test Emrakul, the Aeons Torn) (test Emrakul, the Aeons Torn). Cards without commas are ok (Test Spawnsire of Ulamog). Seen in the wild here.
Any other problems that I'm not remembering?

More tests: Æther Barrier AEther Barrier Gaea´s Liege Gaea’s Liege
Last edited by Korath on 29 Apr 2014, 20:58, edited 2 times in total.
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: Autocard question

Postby silly freak » 14 Apr 2014, 10:48

I have no Idea how the autocard works, but couldn't you fix 2, 3, 4 quick and dirty by adding a space before autocard processing, and removing it afterwards?
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Autocard question

Postby Goblin Hero » 14 Apr 2014, 12:06

Korath wrote:Cards with any but a few non-alphabetic characters don't get matched.
I can modify my database to replace accented characters with the normal ones. I think it will simplify the script.
When you´re a goblin, you don´t have to step forward to be a hero -- everyone else just has to step back.
User avatar
Goblin Hero
Site Admin
Site Admin
 
Posts: 1992
Joined: 23 Oct 2005, 09:37
Location: Russia
Has thanked: 218 times
Been thanked: 351 times

Re: Autocard question

Postby Korath » 14 Apr 2014, 15:31

The accents should be fixable in the query by altering collation. This way, Juzám Djinn and Juzam Djinn would both get highlit, which is a clear win; on the other hand, so would Jüzâm Djíñn. Apparently mysql doesn't have a case-sensitive, accent-insensitive collation for utf8, which is an annoyance; so I'm also getting "JuzAm djinN" highlit in my tests. First letter still needs to be capitalized - "juzAm djinN" remains unhighlit - so maybe that's acceptable.

The more difficult issue with 5 isn't the accent characters, but the numerals, exclamation marks, and other punctuation; changing the data won't help those cases.
silly freak wrote:I have no Idea how the autocard works, but couldn't you fix 2, 3, 4 quick and dirty by adding a space before autocard processing, and removing it afterwards?
2 and 3 perhaps, though I'd rather find out why they get mismatched and fix it properly. 4's unrelated.

I also have a tentative fix for issue 1 ("A " at start of post). Will send it along in a day or two, once I get a chance to look at the others more closely.
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: Autocard question

Postby silly freak » 14 Apr 2014, 21:37

ah, typo, I meant 1, 2 and 3. after adding a space, the post wouldn't begin with "a " of course ;)
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Autocard question

Postby Korath » 17 Apr 2014, 09:07

I've sent fixes for 1-3.

Irritatingly, I can't get the accented strings to match anymore by changing collation, just the unaccented ones, and I can't figure out what I'm doing differently from before. So maybe changing the data would be better after all.

My only guess for #4 is that, looking at the generated html, the apostrophe in Gaea's Liege gets translated to ' within the spoiler tag, but apostrophes outside it (whether as part of a card name or not) don't. So maybe replacing that entity in _mtgPrepareName(), the same way ’ is, might work. 3 and 9 will need to be added to the whitelist of allowed characters in mtgParseString() as well. (Probably the rest of the digits should; 0 and 4 will need to be added for Borrowing 100,000 Arrows, Guan Yu's 1,000-Li March, and Land Aid '04 in any case.)
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: Autocard question

Postby Goblin Hero » 17 Apr 2014, 09:58

Korath wrote:I've sent fixes for 1-3.
Applied.
Korath wrote:So maybe replacing that entity in _mtgPrepareName(), the same way ’ is, might work.
It worked. Also I've extended the string with the possible symbols to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-'’.,!;/&#1234567890" so it closes some of the cases.
When you´re a goblin, you don´t have to step forward to be a hero -- everyone else just has to step back.
User avatar
Goblin Hero
Site Admin
Site Admin
 
Posts: 1992
Joined: 23 Oct 2005, 09:37
Location: Russia
Has thanked: 218 times
Been thanked: 351 times

Re: Autocard question

Postby Korath » 17 Apr 2014, 12:18

The most recent changes broke this post; all the cards in the middle section except Your Inescapable Doom were highlit earlier today. Looks like the comma newly added to the whitelist is to blame.
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: Autocard question

Postby Goblin Hero » 17 Apr 2014, 12:25

Korath wrote:Looks like the comma newly added to the whitelist is to blame.
Oops. Removed the comma.
When you´re a goblin, you don´t have to step forward to be a hero -- everyone else just has to step back.
User avatar
Goblin Hero
Site Admin
Site Admin
 
Posts: 1992
Joined: 23 Oct 2005, 09:37
Location: Russia
Has thanked: 218 times
Been thanked: 351 times

Re: Autocard question

Postby Korath » 17 Apr 2014, 21:03

The period's also causing problems - it causes cards to be matched correctly mid-sentence, but not at the end of one. For example, Giant Growth and Giant Growth. I expect ! will work the same, though it'll be rarer. ; and ' already had the same problem: you should be able to write Giant Growth; and should also be able to talk about Giant Growth's implementation, and have them be highlit.

They'll all need to be handled special, similar to (but not identical to) the way , and : already are. I'll try to take a look tomorrow or this weekend.

The 0 match isn't functional, due to php's... creative... comparison semantics. It either needs to be moved away from the last character of the whitelist (anything else will work fine at the end), or the comparison changed from != FALSE to !== FALSE. This only fixes Land Aid '04, though, not Borrowing 100,000 Arrows or Guan Yu's 1,000-Li March (even if the comma is put back).
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times


Re: Autocard question

Postby Goblin Hero » 13 May 2014, 07:40

Korath's request is implemented. Now autocard works with Planes/Heroes/other nontraditional cards.
Hydra Head Onakke Catacomb Nature Shields Its Own
When you´re a goblin, you don´t have to step forward to be a hero -- everyone else just has to step back.
User avatar
Goblin Hero
Site Admin
Site Admin
 
Posts: 1992
Joined: 23 Oct 2005, 09:37
Location: Russia
Has thanked: 218 times
Been thanked: 351 times

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 20 guests


Who is online

In total there are 20 users online :: 0 registered, 0 hidden and 20 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 20 guests

Login Form