Jump to content

French translation Semeur


kellyl

Recommended Posts

Hi there,

 

I was wondering if it would be possible to add in another French Bible translation, particularly Le Semeur. In my experience in France, protestant churches tend to be about 50:50 on using the Semeur or the Segond 21. I'd love to be able to buy a digital version of the Semeur and use it in Accordance (with an English version as needed!).

 

Thanks.

 

Kelly

  • Like 2
Link to comment
Share on other sites

  • 10 months later...

Bonjour,

J'ai crée un script en Perl qui permet de transformer des fichiers .xml en fichiers text qu'Accordance accepte comme texte Biblique. Le résultat final n'est pas parfait mais c'est mieux que rien. J'ai remarqué certains problèmes avec des caractères et aussi au niveau de la reconnaissance des chapitre dans certains livres (Jonas en particulier). Malheureusement, je n'ai pas eu le temps à date de trouver la  cause du problème.

Vous pouvez lancer le script Perl (que j'ai appelé "parse xml bibles.pl" dans une boucle à partir de votre terminal) :

for f in *.xml; do  ~/Documents/parse\ xml\ bibles.pl $f >> bible.txt; done

Voici le code Perl (à copier dans le fichier "parse xml bibles.pl")

#!/usr/bin/perl 
use strict;
use warnings;

my $bookName;
if ($#ARGV + 1 != 1) {
    print "\nUsage: parseXMLBible.pl bookName.xml\n";
    exit;
}

$bookName = $ARGV[0];
# print "$bookName";

my $fh;
open($fh, "<", $bookName)
	or die "Can't open < $bookName: $!";


my $content = do { local $/; <$fh> };

# strip useless stuff
$content =~ s|<s>.*?</s>||g;
$content =~ s|</v>||g;
$content =~ s|<mt>.*?</mt>||g;
$content =~ s|<p/>||g;
$content =~ s/<q>//g;
$content =~ s|</o>||g;
$content =~ s|<pi/>||g;
$content =~ s|<s3>.*?</s3>||g;
$content =~ s|<ri>.*?</ri>||g;
$content =~ s|<br/>||g;
$content =~ s|</c>||g;
$content =~ s|<ei/>||g;
$content =~ s|</book>||g;
$content =~ s|<fn>.*?</fn>||g;
$content =~ s|<ref.*?</ref>||g;
$content =~ s|<note.*?</note>||gs;
$content =~ s|<\?xml.*?<c>||s;
$content =~ s|<c>||g;
$content =~ s|<bi/>||g;
$content =~ s|</q>||mg;
$content =~ s|<t>.*?</t>||mg;


# now extract info
$content =~ s|<g.*?>(.*?)</g>|\1|g;
$content =~ s|<it>(.*?)</it>|\1|sg;
$content =~ s|<r>.*</r>||g;
$content =~ s|<v>.*<vn>(.*?)</vn>|\1 |g; 	# extract verse numbers
$content =~ s|<cn>(.*?)</cn>\R*|\1:|gs; 	# extract chapter numbers
$content =~ s|\R*:1(\D+)|:1 \1|sg; 			# remove potential lines before 1st verse of chapters
$content =~ s|^(\d+)-(\d+)|\1|mg;			# some books of the bible have a dash between 2 verse numbers
$content =~ s|^ *- *(\d+)|\1|mg; 			# remove dashes that might be at the beginning of lines
$content =~ s|^[ >]*(\d+)|\1|mg; 			# remove spaces that might be before a verse number
$content =~ s|^\((\d+)|\1 (|mg; 			# some verses start with a paranthesis
$content =~ s|^\s*$||mg;					# remove empty lines
$content =~ s|\R\R+|\r|sg;
$content =~ s|^[a-z]+(\d)+|\1|mg;
$content =~ s|<t.*</t>||mg;
$content =~ s|«||mg;


# add in the book name
$bookName =~ s|(.*?)\.xml|\1|sg;
$content = "$bookName\r$content";

# some books have different names; use NEG 79 names
$content =~ s|^(\d+)JN|\1John|mg;
$content =~ s|^EZK|Ezek|mg;
$content =~ s|^JDG|Judg|mg;
$content =~ s|^JUD|Jude|mg;
$content =~ s|^PHP|Phil|mg;
$content =~ s|^SNG|Song|mg;
$content =~ s|^ZEC|Zech|mg;
$content =~ s|^JAS|James|mg;
$content =~ s|^PHM|Philem|mg;
$content =~ s|^JHN|John|mg;
$content =~ s|^JOL|Joel|mg;
$content =~ s|^JON|Jonah|mg;
$content =~ s|^ZEP|ZEPH|mg;
$content =~ s|^MRK|Mark|mg;
$content =~ s|^JOS|Josh|mg;
$content =~ s|^NAM|Nah|mg;
#$content =~ s|^OBA|Obad|mg;



$content =~ s|^(COL)\R*Col|\1|sg; 				# Col appears twice for some reasons

binmode(STDOUT, ":utf8");
print "$content";

close($fh)
      || warn "close failed: $bookName";

Pour que les noms des livres importés fonctionne directement, vous devez choisir NEG79 lors de l'importation du fichier .txt généré.

La version XML que j'ai utilisée se trouve ici : http://www.info-bible.org/bible/telechar.htm(un fichier .zip)

Edited by adrian
  • Like 2
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...