Community > General chatter
iM@S song lyrics (WIKI BENEFICIAL)
Nanashi:
Awesome! (I'd + your karma, but I can't xD)
--- Quote from: Procyon on July 18, 2009, 02:23:11 pm ---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
--- End quote ---
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:
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:
There are a couple of songs that have all their lryics, but aren't formatted yet. Do dai, for example.
Procyon:
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.
Procyon:
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: ---#! /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
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version