-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
183 changed files
with
338 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import * as process from 'process'; | ||
import fsExtra from 'fs-extra'; | ||
import dotenv from 'dotenv'; | ||
import recursive from 'recursive-readdir'; | ||
import pMap from 'p-map'; | ||
import { parse } from '../src/songParser.js'; | ||
import { print } from '../src/songPrinter.js'; | ||
import { | ||
logFileWithLinkInConsole, | ||
logProcessingFile, | ||
NEW_LINE, | ||
} from '../src/index.js'; | ||
import { flatten } from 'lodash-es'; | ||
|
||
import { fileURLToPath } from 'url'; | ||
|
||
const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
|
||
dotenv.config(); | ||
|
||
const RC_BASE = '/Users/ilucut/WORK/BES/bes-lyrics-parser'; | ||
const RC_DIR = `${RC_BASE}/out/resurse_crestine`; | ||
const CANDIDATES_DIR = `/Users/ilucut/WORK/BES/bes-lyrics/candidates`; | ||
|
||
const rcAuthorPathsToProcess = fsExtra | ||
.readFileSync(`${__dirname}/authors_to_process.txt`) | ||
.toString() | ||
.split(NEW_LINE) | ||
.filter(Boolean); | ||
|
||
const readFiles = async (dir: string) => | ||
(await recursive(dir)).map((filePath) => { | ||
return { | ||
contentAsString: fs.readFileSync(filePath).toString(), | ||
fileName: path.basename(filePath), | ||
filePath, | ||
}; | ||
}); | ||
|
||
const runFor = async (songsDirs: string[]) => { | ||
const allSongsInRepo = flatten( | ||
await Promise.all(songsDirs.map(readFiles)), | ||
).map(({ contentAsString }) => parse(contentAsString)); | ||
const allRcIds = allSongsInRepo.map(({ rcId }) => rcId).filter(Boolean); | ||
|
||
await pMap(rcAuthorPathsToProcess, async (pathConfig) => { | ||
const [counts, author, authorPath] = pathConfig.split(':'); | ||
const dirToImportFrom = `${RC_DIR}/${authorPath}`; | ||
(await readFiles(dirToImportFrom)).forEach( | ||
({ contentAsString, filePath, fileName }) => { | ||
const rcSongAST = parse(contentAsString); | ||
logProcessingFile( | ||
fileName, | ||
`Import from RC from ${author}; Counts: ${counts}.`, | ||
); | ||
logFileWithLinkInConsole(filePath); | ||
|
||
if (allRcIds.includes(rcSongAST.rcId)) { | ||
console.log( | ||
`Skip processing the song with RC ID ${rcSongAST.rcId} as we have it in our system.`, | ||
); | ||
console.log(NEW_LINE); | ||
|
||
return; | ||
} | ||
|
||
const authorDirTarget = `${CANDIDATES_DIR}/${rcSongAST.author}`; | ||
|
||
fsExtra.ensureDirSync(authorDirTarget); | ||
fs.writeFileSync(`${authorDirTarget}/${fileName}`, print(rcSongAST)); | ||
}, | ||
); | ||
}); | ||
}; | ||
|
||
await runFor([process.env.VERIFIED_DIR, process.env.CANDIDATES_DIR]); |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
30 changes: 30 additions & 0 deletions
30
verified/trupe_lauda_si_inchinare/Adi Kovaci și Ema Repede - Slava e a ta.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[title] | ||
Slava e a ta {author: {Adi Kovaci și Ema Repede}, contentHash: {0963c7}, id: {k7scbRYnuuQ5UvFMkKJSnN}, rcId: {201507}} | ||
|
||
[sequence] | ||
v1,c,v2,c,v3,c | ||
|
||
[v1] | ||
Ești necuprins, și gloria Ta, | ||
Nimeni n-o pătrunde. | ||
Dar te-ai jertfit, în locul meu, | ||
Vrednic e-al Tău Nume. | ||
|
||
[c] | ||
Slava e a Ța, | ||
Toată Gloria, | ||
Numai Ție ne-închinăm. | ||
Peste noi ești Domn, | ||
Noi te înălțam, | ||
Tu rămâi în veci pe tron. | ||
|
||
[v2] | ||
Acel ce ai fost, | ||
Ești și vei fii, | ||
Domn, în orice vreme. | ||
În veci pe tron, cel înălțat | ||
Sfânt doar Tu esti rege! | ||
|
||
[v3] | ||
/: Glorie în veci, ne închinăm! | ||
Vrednic este Mielul Sfânt, aleluia! :/ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions
36
verified/trupe_lauda_si_inchinare/Alin Timofte - Dumnezeu peste toate.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[title] | ||
Dumnezeu peste toate {author: {Alin Timofte}, contentHash: {f239ba}, id: {sH1WdMXswMAnvr38bkADJn}, rcId: {227447}} | ||
|
||
[sequence] | ||
v1,c,v2,c,e,c | ||
|
||
[v1] | ||
Ești vrednic | ||
Puternic, al lumii Creator | ||
Statornic | ||
Din veci de veci Tu domnești pe tron | ||
De-aceea Îți cânt | ||
Cu-ntregul pământ | ||
Natura declară măreția Ta | ||
|
||
[c] | ||
Tu ești Dumnezeu peste toate | ||
Atotputernic Rege, ești inălțat | ||
Nimic de Tine nu ne desparte | ||
Prin Fiul Tău pe veci ne-ai răscumpărat | ||
Fii Lăudat! Glorificat! | ||
|
||
[v2] | ||
Nu merit | ||
Iertarea ce am primit-o-n dar | ||
Iar pacea | ||
Ce mă inundă prin al Tău har | ||
Ma-ndeamnă sa-Ți cânt | ||
Cu-ntregul pământ | ||
Să stie oricine de iubirea Ta | ||
|
||
[e] | ||
/: Chiar de ar cădea | ||
Zece mii la dreapta mea | ||
Sunt în mâna Ta | ||
Și de-a pururi eu voi declara: :/ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions
39
verified/trupe_lauda_si_inchinare/Anonim - Dati de veste.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[title] | ||
Dati de veste {author: {Anonim}, contentHash: {ac48d2}, id: {3LEqtpDXFqjzzwgeFDm77T}, rcId: {157330}} | ||
|
||
[sequence] | ||
v1,c,v2,c,e | ||
|
||
[v1] | ||
Soarele-a apus ca-n orice zi | ||
Dar neștiind lumea a adormit, | ||
Era o noapte obișnuită | ||
Pentru cei nepăsători | ||
Însă cei ce-au așteptat de mult | ||
Așa au auzit. | ||
|
||
[c] | ||
Dați de veste, îngerii cântă | ||
Glorie, glorie, Rege s-a născut! | ||
Dați de veste, îngerii cântă | ||
Glorie Regelui de sus, | ||
Glorie Regelui Isus. | ||
|
||
[v2] | ||
Vestea era purtată ca de vânt | ||
” | ||
Nu vă temeți, pace pe pământ!” | ||
Bucurie mare aduce | ||
S-a născut un Salvator, | ||
Vestea bună-a mântuirii | ||
Spuneți tuturor. | ||
|
||
[e] | ||
/: Să-I cântăm, glorie, glorie | ||
Regelui, glorie, glorie! | ||
Răspândiți peste tot | ||
Isus s-a născut, e salvator | ||
Să-I cântăm, glorie, glorie | ||
Regelui, glorie, glorie! | ||
Veniți cu toți să ne-nchinăm | ||
Înaintea Lui, să-L adorăm. :/ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
verified/trupe_lauda_si_inchinare/Cătălin și Ramona Lup - Decorul.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[title] | ||
Decorul {author: {Cătălin și Ramona Lup}, contentHash: {7111f5}, id: {mk3TkKw7R5h2hufZDs9P5R}, rcId: {111581}} | ||
|
||
[sequence] | ||
v1,c,v2,c | ||
|
||
[v1] | ||
Aș vrea să mă rog dar nu pot | ||
Cuvinte nu am să pot spune tot | ||
Poate-ar fi mai bine să tac | ||
Un moment de tăcere să las | ||
|
||
[c] | ||
Îndepărtează, Doamne, norul | ||
Ce-asupra mea umbrește-așa des! | ||
Aranjează, Tu, Doamne decorul | ||
Luminos și frumos precum ești! | ||
|
||
[v2] | ||
Aștept acea pace deplină | ||
Pe care doar Tu o poți da | ||
Dar încă ființa mi-e plină | ||
De mare neliniștea mea |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.