1 Introduction
To parse the dynamic lyrics files, the first thing is to clear the dynamic lyrics of the file content, of course, the lyrics of the file content, we have been in the analysis of the article introduced, here will not do a detailed introduction, when we can successfully parse the lyrics, and then combined with the lyrics to create a text, a simple Word format conversion tool will come out.
2 Lyrics Analysis
Lyrics parsing, in fact, the document inside the label content, lyrics time and the content of the lyrics to parse out, of course, in order to later expand other dynamic lyrics format, we have to design a good.
2.1 Entity Class 2.1.1 Lyrics Reader
Mainly used to constrain the dynamic lyrics reader to achieve the method, can be used to expand the implementation of other dynamic lyrics format.
2.1.2 Lyrics Entity
2.1.3 Line Lyrics Entity
2.1.4 Label Entity
2.2KSC parsing 2.2.1 File contents
Karaoke.songname: = ' The love you want ';
Karaoke.singer: = ' Penny Tai ';
Karaoke.add (' 00:03.298 ', ' 00:06.771 ', ' though often dreaming of you ', ' 467,215,195,936,282,568,810 ');
Karaoke.add (' 00:09.571 ', ' 00:12.105 ', ' or no clue ', ' 245,164,211,261,451,1202 ');
Karaoke.add (' 00:14.809 ', ' 00:16.626 ', ' outside is raining ', ' 271,200,195,179,271,266,435 ');
Karaoke.add (' 00:17.245 ', ' 00:19.908 ', ' Today is the day of the Week ', ' 195,143,175,379,758,1013 ');
Karaoke.add (' 00:20.492 ', ' 00:22.089 ', ' [but][i][don ' t][know] ', ' 179,190,286,942 ');
2.2.2 Lyrics Reader Entity
2.2.3 Lyrics parsing part of the code
2.3KRC parsing 2.3.1 File contents
[ID:$00FF2B12]
[ar: Li Jian]
[Ti: Dawn of the United States]
[By:]
[hash:e1c2628fad0a46f94df6b8b071df078f]
[Al:]
[Sign:]
[QQ:]
[total:267096]
[offset:10000]
[language:eyjjb250zw50ijpbxswidmvyc2lvbii6mx0=]
[1679,1550]<0,399,0> <399,200,0> words <599,250,0>:<849,301,0> Lee <1150,400,0> Kin
[3229,1650]<0,350,0> <350,300,0> Song <650,350,0>:<1000,350,0> Lee <1350,300,0> Kin
2.3.2 Lyrics Reader Entity
2.3.3 Lyrics parsing part of the code
2.4HRCX parsing 2.4.1 File contents
[Ti: Right hand ring];
[total:272706];
[AR: Jinhai heart];
[offset:0];
[BY:HAPPYPLAYER-PC];
HAPLAYER.LRC (' <1270,9630> ', ' Golden Sea [heart][-] ' right hand ring ', ' <1010,780,830,1410,800,1210,1410,910> ');
HAPLAYER.LRC (' <18710,19810> ', ' [La][la][la] ', ' <300,400,400> ');
HAPLAYER.LRC (' <20020,22840><77150,79970><163120,165840><191920,194740> ', ' is the girl of your dreams ', ' <200,300,400,300,510,500,610><310,400,300,510,400,400,500><200,510,400,400,410,500,300>< 210,400,300,400,400,510,600> ');
2.4.2 Lyrics Reader Entity
2.4.3 Lyrics parsing part of the code
3 Summary
After the analysis of the above lyrics, I think the lyrics of the cool dog is the most easy to parse.
However, the interpretation of the lyrics of the process, can generally be summarized as follows:
(1) Read the contents of the file, if the content of the lyrics encrypted, to be decrypted
(2) Divide the contents of the file into rows to get the contents of each line
(3) match the line content, determine whether the row of labels, or the lyrics content line
(4) If it is a label line content, the content is resolved according to the label type
(5) If it is a line of lyrics, the content of the lyrics is parsed according to the lyrics format (mainly used in regular expressions)
4 references
Analysis of KRC lyrics file for cool dog
5 Source code
Lyrics parsing and generator
6 Last
In the next article, we will introduce the display of dynamic lyrics. If there is infringement, please inform.
On dynamic lyrics-lyrics analysis