It is currently 22 Sep 2018, 11:01
   
Text Size

Magic Grammar

General Discussion of the Intricacies

Moderator: CCGHQ Admins

Re: Magic Grammar

Postby Arch » 27 Oct 2011, 08:39

I'm not sure what data source I'm using. I just grabbed the current data I had at that point in time.

The real/user/sys is the output from the *nix time program. You would use it like: time java -jar ... and it would run the program and output the stats. Real is the real-world time it took to execute the program. User + sys is the time it took for the computer to run it. (Since I have 4 cores the user + sys is around 4 times the real time.)

Based on the values here your setup is something like 100 to 1000 times faster than mine.
User avatar
Arch
Programmer
 
Posts: 206
Joined: 04 Jul 2009, 09:35
Has thanked: 0 time
Been thanked: 15 times

Re: Magic Grammar

Postby Max mtg » 31 Oct 2011, 05:34

silly freak wrote:Anyway, I've put together a blog post about my accomplishment so far. Do you (all) have anything to look at? It would be very inspirational!
It has not changed much since the beginning of month, but there's what I have.

Need VS2010 or Visual C# 2010 Express to build.
After opening the project make sure that the paths set up in App.config are correct for your system
Attachments
ParseRules.zip
(110.97 KiB) Downloaded 205 times
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Magic Grammar

Postby MageKing17 » 31 Oct 2011, 06:27

silly freak wrote:I use Magic Data 2011/10/01, and after filtering that, it seems to contain 11889 unique abilities.
Allow me to ignore most of the conversational thread and focus on one thing you said: by "unique abilities", is that counting "Darksteel Colossus is indestructible." and "Blightsteel Colossus is indestructible." as two separate abilities, or one unique ability?
User avatar
MageKing17
Programmer
 
Posts: 473
Joined: 12 Jun 2008, 20:40
Has thanked: 5 times
Been thanked: 9 times

Re: Magic Grammar

Postby silly freak » 02 Nov 2011, 08:22

MageKing17 wrote:
silly freak wrote:I use Magic Data 2011/10/01, and after filtering that, it seems to contain 11889 unique abilities.
Allow me to ignore most of the conversational thread and focus on one thing you said: by "unique abilities", is that counting "Darksteel Colossus is indestructible." and "Blightsteel Colossus is indestructible." as two separate abilities, or one unique ability?
good question! I didn't really put thought into that... I read individual abilities from Magic Data, stripped the name and put it into a set, thus ignoring duplicates. so the string "~ is indestructible" is unique in my file.
___

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: Magic Grammar

Postby MageKing17 » 03 Nov 2011, 16:12

silly freak wrote:
MageKing17 wrote:
silly freak wrote:I use Magic Data 2011/10/01, and after filtering that, it seems to contain 11889 unique abilities.
Allow me to ignore most of the conversational thread and focus on one thing you said: by "unique abilities", is that counting "Darksteel Colossus is indestructible." and "Blightsteel Colossus is indestructible." as two separate abilities, or one unique ability?
good question! I didn't really put thought into that... I read individual abilities from Magic Data, stripped the name and put it into a set, thus ignoring duplicates. so the string "~ is indestructible" is unique in my file.
Fascinating. 11889 truly unique abilities... my overly-simplistic parser feels woefully inadequate for some reason.
User avatar
MageKing17
Programmer
 
Posts: 473
Joined: 12 Jun 2008, 20:40
Has thanked: 5 times
Been thanked: 9 times

Re: Magic Grammar

Postby silly freak » 11 Nov 2011, 11:26

Update: after searching for the truncated card names, too (like "Akroma" in "Akroma, Angel of Wrath") it's only 11879 any more. I only splitted at the first comma, I don't know if other such cases exist...

Here's my most recent stats. I've rewritten some code; the timing is now more strictly only parsing, no output processing any more, and my data source now contains enough information to calculate unique abilities, duplicate abilities and complete cards. (it's here for anyone in need of a data source)

Code: Select all
Abilities: 11879; Successful:  1222, Failed: 10657 (10.3%)
With dups: 19710; Successful:  6079, Failed: 13631 (30.8%)
Cards:     12237; Successful:  1600, Failed: 10637 (13.1%)

2.2 s for 11879 abilities (181487 ns per ability)
___

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: Magic Grammar

Postby MageKing17 » 13 Nov 2011, 20:01

silly freak wrote:Update: after searching for the truncated card names, too (like "Akroma" in "Akroma, Angel of Wrath") it's only 11879 any more. I only splitted at the first comma, I don't know if other such cases exist...
IIRC, there are three possible "Legendname" formats: "<Name>, <Title>", "<Name> of <Whatever>", and "<Name> the <Title>". If you make your search (after full CARDNAME replacements, of course) look for the name but with the regexp "(, | of | the ).*" stripped out, it should grab all such instances.
User avatar
MageKing17
Programmer
 
Posts: 473
Joined: 12 Jun 2008, 20:40
Has thanked: 5 times
Been thanked: 9 times

Re: Magic Grammar

Postby silly freak » 14 Nov 2011, 08:17

MageKing17 wrote:
silly freak wrote:Update: after searching for the truncated card names, too (like "Akroma" in "Akroma, Angel of Wrath") it's only 11879 any more. I only splitted at the first comma, I don't know if other such cases exist...
IIRC, there are three possible "Legendname" formats: "<Name>, <Title>", "<Name> of <Whatever>", and "<Name> the <Title>". If you make your search (after full CARDNAME replacements, of course) look for the name but with the regexp "(, | of | the ).*" stripped out, it should grab all such instances.
Thanks for your tip! I tried that, but there are unfortunately false positives with that: Flash of Defiance and Tuktuk the Explorer for example. The second is especially nasty because it's even a legendary creature, so being legendary is not enough to see whether nicknames are appropriate. It's logged in my mind now, I'm sure there's a way.
___

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: Magic Grammar

Postby MageKing17 » 14 Nov 2011, 09:37

silly freak wrote:Thanks for your tip! I tried that, but there are unfortunately false positives with that: Flash of Defiance and Tuktuk the Explorer for example. The second is especially nasty because it's even a legendary creature, so being legendary is not enough to see whether nicknames are appropriate. It's logged in my mind now, I'm sure there's a way.
Oh man, I did not think of Tuktuk the Explorer. On the other hand, I'm pretty sure anything appearing after the word "named" should be treated specially, because you don't want to do ~-substitution for, say, Brothers Yamazaki. It would interact strangely with Sakashima the Impostor, for one thing.
User avatar
MageKing17
Programmer
 
Posts: 473
Joined: 12 Jun 2008, 20:40
Has thanked: 5 times
Been thanked: 9 times

Previous

Return to Magic Rules Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 1 guest

Login Form