zen0wu / topcoder-greed

greedy editor for topcoder arena
Apache License 2.0
229 stars 45 forks source link

Contest name renderer #65

Closed vexorian closed 10 years ago

vexorian commented 10 years ago

I have an issue with contest names, which is caused by topcoder giving different names during SRMs than to practice rooms.

During the contest, the name of the srm is usually "Single Round Match 596".

But the name of the practice room is "SRM 596 DIV 1".

This means that if you separate by folder, you have to manually rename the "Single Round Match 596" after a match before entering practice.

(By the way, this also means that during a match, the division number detection doesn't actually work).

So what I've been thinking is to add a renderer. The renderer smartly translates "Single Round Match XXX" to "SRM XXX". Why stop there? Maybe we can find a way to normalize all TCO match names into "TCO 2009 Round 3C".

Or maybe better than a renderer is to have an Contest.AbreviatedName variable in addition to the Contest.Name one?

wookayin commented 10 years ago

In my humble opinion, I'd prefer to respect the contest name provided by arena as-is.

vexorian commented 10 years ago

It would be an optional thing.

zen0wu commented 10 years ago

In fact, I've implemented this function. An abbr string renderer by ${XXX;string(abbr)}. It can transform Single Round Match to SRM. Do you think this is enough?

vexorian commented 10 years ago

It seems it works. Have you considered making it remove special characters? Some TCO matches have ' on them.

zen0wu commented 10 years ago

About the special characters you mentioned, do you think just removing them should be enough? Then it would have a hard-coded special characters list, because controlling which characters are removed in the parameters of the renderer may not be a realistic solution.

This is not a simple problem if we want to cover more situations, because the user may have various thoughts about how to normalise the name. I think we should bring more consideration into this problem. For example, from Single Round Match 123, user may want SRM123, or SRM 123, or srm123. The SRM 123 may not be achievable by now.

vexorian commented 10 years ago

Hence why my first idea was a special renderer :)

TCO matches are rare, so I think I can live with just the abbvr renderer.

On Thu, Nov 14, 2013 at 8:01 AM, Shiva Wu notifications@github.com wrote:

About the special characters you mentioned, do you think just removing them should be enough? Then it would have a hard-coded special characters list, because controlling which characters are removed in the parameters of the renderer may not be a realistic solution.

This is not a simple problem if we want to cover more situations, because the user may have various thoughts about how to normalise the name. I think we should bring more consideration into this problem. For example, from Single Round Match 123, user may want SRM123, or SRM 123, or srm123. The SRM 123may not be achievable by now.

— Reply to this email directly or view it on GitHubhttps://github.com/shivawu/topcoder-greed/issues/65#issuecomment-28478572 .

vexorian commented 10 years ago

hmnn a small issue is that it abbreviates TCO11 into "T".

zen0wu commented 10 years ago

OK, so the rules should be "ignoring the abbreviation when this token is all uppercase OR digits". Is this enough?

vexorian commented 10 years ago

That's probably it, if you want to. As I said TCO matches are rare so I can live with this.