Username: Password:

Author Topic: iM@S song lyrics (WIKI BENEFICIAL)  (Read 25842 times)

Procyon

  • Greenhorn
  • *
  • Posts: 43
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #15 on: July 17, 2009, 03:40:27 pm »
From the romanization thread
Anyway, if Procyon's suggestion for a new table layout is passed as the new standard, I will have to take back what I said about not capitalizing the first letter of a new line of romaji. Capitalizing it will make it easier to see where the real line break is when lines are split because the of size limit of their column.
We can try without forced width. I was wrong about 33% all, so I set it to something arbitrary, but without width arguments it can work too. I removed it now to try it out.

Nanashi

  • Guest
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #16 on: July 17, 2009, 03:51:38 pm »
I didn't mean to say I didn't like forced width if that's what it sounded like.  It's just that that way the line splitting was bound to happen more than it does now (in IE at least). Of course that happens in any layout though, so maybe capitalizing was better to begin with anyway...

At any rate, without the widths it does look better than it did before in my opinion.

Trance Blossom

  • Member
  • ***
  • Posts: 172
  • The Variety Animal
    • My Music
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #17 on: July 17, 2009, 05:00:09 pm »
I like the "new" format.

yukipo

  • Guest
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #18 on: July 17, 2009, 08:04:08 pm »
Yeah, that table template thing definitely seems neater than the other one, easier to use, too.
I'll get to work with it a bit later in the day, still drowsy. How about I completely remove songs from The Hallowed List of Lyrics when they're all finished and have the template and everything? That way we can get all the songs in the format they're supposed to be in.
/tired (sorry if none of that made sense)

Nanashi

  • Guest
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #19 on: July 17, 2009, 08:58:35 pm »
That makes sense. Although if we're permanently going with the new template then wouldn't that mean adding every single song on the wiki except L<>R to the List at first?

yukipo

  • Guest
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #20 on: July 18, 2009, 01:42:18 am »
Huhwhat?
PLease explain.

Nanashi

  • Guest
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #21 on: July 18, 2009, 01:56:31 am »
Well... what I meant was that if we choose to make Procyon's format the standard, none of the songs in the wiki will have the correct format (except L<>R), because they're not in the new format yet. The songs can only be removed from the List once they do have the correct format. Therefore all songs (except L<>R) would have to be on the list in order for it to be complete.

Procyon

  • Greenhorn
  • *
  • Posts: 43
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #22 on: July 18, 2009, 11:22:07 am »
I wrote a table transformation script.

It should be able to change an old table into a new table, I tried it out on a complex page and it worked, but in some cases some adjustment is probably necessary.

It's not for wikibots, but I can bind the script to a key and it can work on the paste buffer (so it's just: Mark table, Control+C, Script Button, Control+V). It is written in awk, so it will only work on Linux.

Hopefully, the whole process will go smooth.

Procyon

  • Greenhorn
  • *
  • Posts: 43
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #23 on: July 18, 2009, 01:27:17 pm »
There was a small error in that border="0" came out as border= ", it doesn't change the page though (actually border seems to be completely ignored with class="wikitable" I just put it there for later convenience), but I'll fix it for the pages I changed so far. (to border=0)

Procyon

  • Greenhorn
  • *
  • Posts: 43
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #24 on: July 18, 2009, 02:23:11 pm »
OK done. If I missed one, post it here.

About new pages, it is probably easier to make the old layout, because it is also of the form:
all kanji lyrics
all romaji
all translation

Just like most pages without table now. So don't hesitate to make an old table and post about it here so I can run the script on it.

And I said earlier Harikiri Rally had kanji lyrics, but I must have forgotten to save the page last week... Will look it up again.

BTW here is the script, in case you want to transform tables yourself:
Code: [Select]
#! /bin/bash
xsel -o -b | awk 'BEGIN { collect=0; run=0
print "{|border=0 style=\x22text-align:left;\x22 class=\x22wikitable\x22"
print "!Japanese/Kanji Lyrics"
print "!Romanized Lyrics"
print "!Translated Lyrics"
print ""
}
{ if ($1 ~ /^!/) { if (run==1) {max=i}; run+=1; i=0;}
  if ($1 ~ /^\|-style=/) {
    if (run == 1) {
      collect=1; i++; stylearr[i]=$0;
    }
    if (run > 1) {
      i++
    }
  }
  if (collect == 1 && $0 ~ /^[^{|!]/) {
    if (tar[i","run] ~ /..../) {tar[i","run]=tar[i","run] "\n" $0} else {tar[i","run]=$0}
  }
}
END {
for (count=1;count<max+1;count++) { print stylearr[count]; print "||"; print tar[count",1"]; print "||"; print tar[count",2"]; print "||"; print tar[count",3"]; }
 print "|}"
}' | xsel -i -b

Nanashi

  • Guest
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #25 on: July 18, 2009, 02:47:22 pm »
Awesome! (I'd + your karma, but I can't xD)

About new pages, it is probably easier to make the old layout, because it is also of the form:
all kanji lyrics
all romaji
all translation
I think I'd rather make new tables over old tables anyway, since it'll be easier to spot mistakes when grouping the corresponding Japanese/romaji/translation together. (Often line breaks aren't in the same places or lines might even be missing, and only noticing that afterwards is annoying.) But that's just my opinion.

By the way, you might want to add that script and a sample of the new layout to the Main Page talk where the old format is now.

yukipo

  • Guest
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #26 on: July 18, 2009, 07:25:24 pm »
OKay, I get it now. I will OFFICIALLY BE REMOVING SONGS FROM THE HALLOWED LIST  OF LYRICS ONCE THEY HAVE BEEN TABLE-IZED

Trance Blossom

  • Member
  • ***
  • Posts: 172
  • The Variety Animal
    • My Music
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #27 on: July 18, 2009, 07:34:39 pm »
There are a couple of songs that have all their lryics, but aren't formatted yet. Do dai, for example.

Procyon

  • Greenhorn
  • *
  • Posts: 43
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #28 on: July 18, 2009, 08:02:54 pm »
Before table-izing, there is another issue sometimes. Compare these two:
http://www.project-imas.com/w/My_song
http://www.project-imas.com/w/Do-Dai

Do-Dai needs spacing between verses/chorus and romaji/translation need to line up with kanji line by line. For Do-Dai it lines up nicely and the translation has correct spacing. But for others it can be quite hard. (like rechecking of all the translation. Edit: I mean like what kanji goes with what romaji and translation)

Anyway, if it's like My Song, then I think it's possible to make another script that transforms it into a table.
« Last Edit: July 18, 2009, 08:21:26 pm by Procyon »

Procyon

  • Greenhorn
  • *
  • Posts: 43
Re: iM@S song lyrics (WIKI BENEFICIAL)
« Reply #29 on: July 19, 2009, 01:52:45 pm »
I finished the script to transform correctly formatted pages to the new table layout. I will go through the pages again (thanks for categorizing everything Nanashi)

The script works on paragraphs separated by an empty line or a line with just "<br" (as in "<br />" or "<br/>" or "<br>"). Kanji / Romaji / Translation need to be separated by "==" (as in "== Translation ==", or "== Romaji ==")
The script will ignore any blank lines after a == until there is actually text. The first line that it works on needs to be text (kanji) and not a blank line, and not "== Lyrics ==" for example.

So if you format a page make sure each section (kanji/romaji/translation) has the same amount of paragraphs.

Script here if you want to try it yourself
Code: [Select]
#! /bin/bash
xsel -o -b | awk 'BEGIN { run=0; initialignore=0; i=0
print "{|border=\x22""0\x22 style=\x22text-align:left;\x22 class=\x22wikitable\x22"
print "!Japanese/Kanji Lyrics"
print "!Romanized Lyrics"
print "!Translated Lyrics"
print ""
}
{ if ($1 ~ /^==/) { if (run==0) {max=i}; run+=1; i=0; initialignore=1}
  if ($1 ~ /^<br/ || $1 ~ /^ *$/ && initialignore==0) {
      i++
  }
  if ($0 ~ /^[^<=]/) {
    initialignore=0
    if (tar[i","run] ~ /..../) {tar[i","run]=tar[i","run] "\n" $0} else {tar[i","run]=$0}
  }
}
END {
for (count=0;count<max;count++) { if (count % 2 == 0) {print "|-style=\x22""background:#dddddd;\x22"} else {print "|-style=\x22""background:#ffffdd;\x22"}; print "||"; print tar[count",0"]; print "||"; print tar[count",1"]; print "||"; print tar[count",2"]; }
 print "|}"
}' | xsel -i -b
« Last Edit: July 19, 2009, 01:54:34 pm by Procyon »