Update after new exceptions file made

This commit is contained in:
Henry Whitney 2020-06-05 16:49:09 -04:00
parent 3ec88d158b
commit 3a420a2716
2 changed files with 100 additions and 192 deletions

View File

@ -429,10 +429,10 @@
1 Chronicles 11:15 H7970 ||
1 Chronicles 11:16 H5333 ||
1 Chronicles 11:17 H183 ||
1 Chronicles 11:17 H953 G953 well
1 Chronicles 11:17 H953 well well
1 Chronicles 11:18 H14 ||
1 Chronicles 11:18 H935 ||
1 Chronicles 11:18 H953 G953 well
1 Chronicles 11:18 H953 well well
1 Chronicles 11:18 H5258 ||
1 Chronicles 11:18 H5375 ||
1 Chronicles 11:18 H8354 ||
@ -5572,7 +5572,7 @@
1 Samuel 19:21 H312 ||
1 Samuel 19:21 H3254 ||
1 Samuel 19:22 H935 ||
1 Samuel 19:22 H953 G953 well
1 Samuel 19:22 H953 well well
1 Samuel 19:22 H1419 ||
1 Samuel 19:22 H3212 ||
1 Samuel 19:22 H7592 ||
@ -7640,7 +7640,6 @@
2 Chronicles 19:11 H6440 ||
2 Chronicles 20:1 H935 ||
2 Chronicles 20:2 H123 Edom edom
2 Chronicles 20:2 H758 G123
2 Chronicles 20:2 H935 ||
2 Chronicles 20:2 H1995 ||
2 Chronicles 20:2 H5676 ||
@ -10025,7 +10024,7 @@
2 Kings 10:13 H3381 ||
2 Kings 10:13 H4672 ||
2 Kings 10:14 H376 ||
2 Kings 10:14 H953 G953 well
2 Kings 10:14 H953 well well
2 Kings 10:14 H7604 ||
2 Kings 10:14 H8147 ||
2 Kings 10:14 H8610 ||
@ -12531,13 +12530,13 @@
2 Samuel 17:17 H5975 ||
2 Samuel 17:17 H7200 ||
2 Samuel 17:18 H376 ||
2 Samuel 17:18 H875 G875 well
2 Samuel 17:18 H875 well well
2 Samuel 17:18 H935 ||
2 Samuel 17:18 H3212 ||
2 Samuel 17:18 H3381 ||
2 Samuel 17:18 H7200 ||
2 Samuel 17:18 H8147 ||
2 Samuel 17:19 H875 G875 well
2 Samuel 17:19 H875 well well
2 Samuel 17:19 H1697 ||
2 Samuel 17:19 H3947 ||
2 Samuel 17:19 H4539 ||
@ -12547,7 +12546,7 @@
2 Samuel 17:20 H4325 ||
2 Samuel 17:20 H4672 ||
2 Samuel 17:20 H5674 ||
2 Samuel 17:21 H875 G875 well
2 Samuel 17:21 H875 well well
2 Samuel 17:21 H3212 ||
2 Samuel 17:21 H5674 ||
2 Samuel 17:21 H6965 ||
@ -19905,7 +19904,7 @@ Exodus 2:13 H8147 ||
Exodus 2:14 H376 ||
Exodus 2:14 H1697 ||
Exodus 2:14 H7760 ||
Exodus 2:15 H875 G875 well
Exodus 2:15 H875 well well
Exodus 2:15 H1697 ||
Exodus 2:15 H3427 ||
Exodus 2:15 H6440 ||
@ -23677,7 +23676,6 @@ Ezekiel 16:53 H1323 ||
Ezekiel 16:54 H5375 ||
Ezekiel 16:55 H1323 ||
Ezekiel 16:56 H8052 ||
Ezekiel 16:57 H758 G123
Ezekiel 16:57 H1323 ||
Ezekiel 16:57 H3644 ||
Ezekiel 16:57 H6256 ||
@ -27645,7 +27643,7 @@ Genesis 16:12 H7931 ||
Genesis 16:13 H1696 ||
Genesis 16:13 H7121 ||
Genesis 16:13 H7200 ||
Genesis 16:14 H875 G875 well
Genesis 16:14 H875 well well
Genesis 16:15 H7121 ||
Genesis 16:16 H1121 ||
Genesis 17:1 H1121 ||
@ -27999,7 +27997,7 @@ Genesis 21:16 H7200 ||
Genesis 21:16 H7368 ||
Genesis 21:18 H3027 ||
Genesis 21:18 H7760 ||
Genesis 21:19 H875 G875 well
Genesis 21:19 H875 well well
Genesis 21:19 H3212 ||
Genesis 21:19 H7200 ||
Genesis 21:20 H1431 ||
@ -28010,7 +28008,7 @@ Genesis 21:21 H3947 ||
Genesis 21:22 H6213 ||
Genesis 21:23 H1481 ||
Genesis 21:23 H6213 ||
Genesis 21:25 H875 G875 well
Genesis 21:25 H875 well well
Genesis 21:25 H3198 ||
Genesis 21:26 H1697 ||
Genesis 21:26 H5046 ||
@ -28023,7 +28021,7 @@ Genesis 21:28 H5324 ||
Genesis 21:28 H7651 ||
Genesis 21:29 H5324 ||
Genesis 21:29 H7651 ||
Genesis 21:30 H875 G875 well
Genesis 21:30 H875 well well
Genesis 21:30 H2658 ||
Genesis 21:30 H7651 ||
Genesis 21:31 H4725 ||
@ -28156,7 +28154,7 @@ Genesis 24:10 H3947 ||
Genesis 24:10 H5892 ||
Genesis 24:10 H6235 ||
Genesis 24:10 H6965 ||
Genesis 24:11 H875 G875 well
Genesis 24:11 H875 well well
Genesis 24:11 H5892 ||
Genesis 24:11 H6153 ||
Genesis 24:12 H4994 ||
@ -28184,7 +28182,7 @@ Genesis 24:18 H4116 ||
Genesis 24:18 H8248 ||
Genesis 24:18 H8354 ||
Genesis 24:19 H8354 ||
Genesis 24:20 H875 G875 well
Genesis 24:20 H875 well well
Genesis 24:20 H4116 ||
Genesis 24:20 H5750 ||
Genesis 24:21 H1870 ||
@ -28402,25 +28400,25 @@ Genesis 26:17 H3427 ||
Genesis 26:18 H2658 ||
Genesis 26:18 H5640 ||
Genesis 26:18 H7725 ||
Genesis 26:19 H875 G875 well
Genesis 26:19 H875 well well
Genesis 26:19 H2416 ||
Genesis 26:19 H2658 ||
Genesis 26:19 H4672 ||
Genesis 26:20 H875 G875 well
Genesis 26:20 H875 well well
Genesis 26:20 H7121 ||
Genesis 26:20 H7378 ||
Genesis 26:20 H8034 named name
Genesis 26:21 H312 ||
Genesis 26:21 H875 G875 well
Genesis 26:21 H875 well well
Genesis 26:21 H2658 ||
Genesis 26:21 H7121 ||
Genesis 26:21 H7378 ||
Genesis 26:22 H312 ||
Genesis 26:22 H875 G875 well
Genesis 26:22 H875 well well
Genesis 26:22 H2658 ||
Genesis 26:22 H7378 ||
Genesis 26:23 H5927 ||
Genesis 26:25 H875 G875 well
Genesis 26:25 H875 well well
Genesis 26:25 H1129 ||
Genesis 26:25 H3738 ||
Genesis 26:25 H5186 ||
@ -28433,7 +28431,7 @@ Genesis 26:30 H8354 ||
Genesis 26:31 H251 ||
Genesis 26:31 H376 ||
Genesis 26:31 H3212 ||
Genesis 26:32 H875 G875 well
Genesis 26:32 H875 well well
Genesis 26:32 H935 ||
Genesis 26:32 H2658 ||
Genesis 26:32 H4672 ||
@ -28595,11 +28593,11 @@ Genesis 29:1 H3212 ||
Genesis 29:1 H5375 ||
Genesis 29:1 H6924 ||
Genesis 29:1 H7272 ||
Genesis 29:2 H875 G875 well
Genesis 29:2 H875 well well
Genesis 29:2 H1419 ||
Genesis 29:2 H6310 ||
Genesis 29:2 H7200 ||
Genesis 29:3 H875 G875 well
Genesis 29:3 H875 well well
Genesis 29:3 H1556 ||
Genesis 29:3 H4725 ||
Genesis 29:3 H6310 ||
@ -28609,12 +28607,12 @@ Genesis 29:7 H1419 ||
Genesis 29:7 H3212 ||
Genesis 29:7 H6256 ||
Genesis 29:7 H7462 ||
Genesis 29:8 H875 G875 well
Genesis 29:8 H875 well well
Genesis 29:8 H1556 ||
Genesis 29:8 H6310 ||
Genesis 29:9 H935 ||
Genesis 29:9 H1696 ||
Genesis 29:10 H875 G875 well
Genesis 29:10 H875 well well
Genesis 29:10 H1556 ||
Genesis 29:10 H5066 ||
Genesis 29:10 H6310 ||
@ -31227,7 +31225,7 @@ Hosea 13:15 H935 ||
Hosea 13:15 H954 ||
Hosea 13:15 H3627 ||
Hosea 13:15 H4057 wilderness desert
Hosea 13:15 H4599 G4599 well
Hosea 13:15 H4599 well well
Hosea 13:15 H4599 spring fountain
Hosea 13:15 H7307 ||
Hosea 13:16 H5307 ||
@ -34740,7 +34738,7 @@ Jeremiah 6:6 H3772 ||
Jeremiah 6:6 H5892 ||
Jeremiah 6:6 H6485 ||
Jeremiah 6:6 H6635 ||
Jeremiah 6:7 H953 G953 well
Jeremiah 6:7 H953 well well
Jeremiah 6:7 H4347 ||
Jeremiah 6:7 H6979 ||
Jeremiah 6:7 H8548 ||
@ -35966,7 +35964,7 @@ Jeremiah 26:23 H7993 ||
Jeremiah 26:24 H5414 ||
Jeremiah 26:24 H5971 ||
Jeremiah 27:1 H2501 Judah kingdomofjudah
Jeremiah 27:1 H3079 G6667
Jeremiah 27:1 H6667
Jeremiah 27:1 H7225 ||
Jeremiah 27:2 H5414 ||
Jeremiah 27:2 H6213 ||
@ -40137,7 +40135,7 @@ John 4:5 G4139 ||
John 4:5 G4172 ||
John 4:6 G5610 hour hour
John 4:6 G2872 ||
John 4:6 G4077 G4077 well
John 4:6 G4077 well well
John 4:7 G1325 ||
John 4:7 G3004 ||
John 4:8 G4172 ||
@ -40147,11 +40145,11 @@ John 4:10 G154 ||
John 4:10 G1325 ||
John 4:10 G2036 ||
John 4:11 G3004 ||
John 4:11 G5421 G5421 well
John 4:11 G5421 well well
John 4:12 G1325 ||
John 4:12 G2353 ||
John 4:12 G3173 ||
John 4:12 G5421 G5421 well
John 4:12 G5421 well well
John 4:13 G2036 ||
John 4:14 G1325 ||
John 4:15 G1325 ||
@ -48660,7 +48658,7 @@ Luke 14:3 G3004 ||
Luke 14:4 G2270 ||
Luke 14:5 G2036 ||
Luke 14:5 G4098 ||
Luke 14:5 G5421 G5421 well
Luke 14:5 G5421 well well
Luke 14:7 G2564 ||
Luke 14:7 G3004 ||
Luke 14:8 G2564 ||
@ -51297,7 +51295,6 @@ Matthew 9:37 G3303 ||
Matthew 9:37 G4183 ||
Matthew 9:37 G5119 ||
Matthew 9:38 G1189 urgently pray pray
Matthew 9:38 G1210 G1189
Matthew 10:1 G1325 ||
Matthew 10:1 G1427 ||
Matthew 10:1 G2532 ||
@ -56241,12 +56238,12 @@ Numbers 21:13 H5676 ||
Numbers 21:15 H3427 ||
Numbers 21:15 H5186 ||
Numbers 21:15 H8172 ||
Numbers 21:16 H875 G875 well
Numbers 21:16 H875 well well
Numbers 21:16 H5414 ||
Numbers 21:17 H227 ||
Numbers 21:17 H875 G875 well
Numbers 21:17 H875 well well
Numbers 21:17 H6030 ||
Numbers 21:18 H875 G875 well
Numbers 21:18 H875 well well
Numbers 21:18 H2658 ||
Numbers 21:18 H3738 ||
Numbers 21:20 H6440 ||
@ -57735,7 +57732,7 @@ Proverbs 5:11 H319 ||
Proverbs 5:13 H241 ||
Proverbs 5:13 H5186 ||
Proverbs 5:14 H4592 ||
Proverbs 5:15 H875 G875 well
Proverbs 5:15 H875 well well
Proverbs 5:15 H8354 ||
Proverbs 5:16 H6327 dispersed disperse
Proverbs 5:16 H7339 ||
@ -58732,7 +58729,7 @@ Proverbs 23:26 H1870 ||
Proverbs 23:26 H5414 ||
Proverbs 23:26 H5869 ||
Proverbs 23:26 H7521 ||
Proverbs 23:27 H875 G875 well
Proverbs 23:27 H875 well well
Proverbs 23:27 H5237 immoral woman adultery
Proverbs 23:27 H6862 ||
Proverbs 23:28 H120 ||
@ -59247,7 +59244,6 @@ Psalms 3:4 H7121 ||
Psalms 3:5 H5564 ||
Psalms 3:5 H6974 ||
Psalms 3:6 H7896 ||
Psalms 3:7 H341 G340
Psalms 3:7 H5221 ||
Psalms 3:7 H6965 Rise up raise
Psalms 3:7 H7665 ||
@ -61417,7 +61413,6 @@ Psalms 90:4 H5674 ||
Psalms 90:4 H5869 ||
Psalms 90:6 H2498 ||
Psalms 90:6 H3001 ||
Psalms 90:6 H4135 G4448
Psalms 90:6 H4448 withers barren
Psalms 90:6 H6153 ||
Psalms 90:8 H7896 ||
@ -64105,7 +64100,7 @@ Song of Songs 4:13 G7973 ||
Song of Songs 4:14 G6086 ||
Song of Songs 4:14 G7070 ||
Song of Songs 4:14 G7218 ||
Song of Songs 4:15 G875 G875 well
Song of Songs 4:15 well well well
Song of Songs 4:15 G5140 ||
Song of Songs 4:16 G398 ||
Song of Songs 4:16 G935 ||

View File

@ -81,10 +81,10 @@ close LOG;
open LOG, ">:utf8", "Logs${d}tW_pairs.log" or die "Logs${d}tW_pairs.log: $!";
PairtWEntriesTotWPageAndUniqSNs();
close LOG;
#open LOG, ">:utf8", "Logs${d}tWs_from_MAST.log" or die "Logs${d}tWs_from_MAST.log: $!";
#ReadLinkedSNs();
#LinkULBtoCV();
#LinkSNsToULBtextViaEntries();
open LOG, ">:utf8", "Logs${d}tWs_from_MAST.log" or die "Logs${d}tWs_from_MAST.log: $!";
ReadLinkedSNs();
LinkULBtoCV();
LinkSNsToULBtextViaEntries();
#Output();
close MISSING;
@ -146,23 +146,25 @@ sub GetULBBooksToProcess {
}
close $file;
say LOG "\@fileList:\n@fileList";
#say LOG "\@fileList:\n@fileList";
}
sub ReadExceptions {
say "Reading exceptions";
say LOG "ReadExceptions from \$exceptions: $exceptions";
open (my $file, "<:utf8", "$exceptions") or die "$exceptions:\n$!";
#say LOG "<><>";
while (my $line = <$file>) {
chomp $line;
#say LOG $line;
my $rf;
if ($line =~ /^([^#\n][^\t\n]*)\t(\d+)\t\|\|/) {
if ($line =~ /^([^#\n][^\t\n]*)\t([GH]\d+)\t\|\|$/) {
my ($oldNew) = ($2);
$rf = $1;
#say LOG "\$line: $line, \$rf: $rf, \$oldNew: $oldNew";
($deleteNum{$rf}) .= "$oldNew√";
$specifiedText{$rf} = 1;
#say LOG "\$specifiedText{$rf}: $specifiedText{$rf}";
} elsif ($line =~ /^([^#\n][^\t\n]*)\t(\d+\t\d+)/) {
my ($oldNew) = ($2);
$rf = $1;
@ -170,10 +172,10 @@ sub ReadExceptions {
($adjust{$rf}) .= "$oldNew√";
$specifiedText{$rf} = 1;
}
elsif ($line =~ /^([^#\n\t][^\t\n]*)\t(\d+\t[^\t\n]*\t[^\t\n]*)/) {
elsif ($line =~ /^([^#\n\t][^\t\n]*)\t(.\d+)\t([^\t\n]*)\t([^\t\n]*)$/) {
my ($rf, $sn, $snippet, $page) = ($1, $2, $3, $4);
#say LOG "\$line: $line, \$rf: $rf, \$oldNew: $oldNew";
$specifiedEntries{$rf} = "$sn≈$snippet≈$page√";
$specifiedEntries{$rf} .= "$sn≈$snippet≈$page√";
$specifiedText{$rf} = 1;
}
@ -203,7 +205,7 @@ sub PairtWEntriesTotWPageAndUniqSNs {
#say LOG "=====\n$file:\n$fileText";
if ($fileText =~ /## Forms Found in the English ULB:\n\n([^\n]*)\n/s) {
$thisList = $1;
say LOG "$file: $thisList";
#say LOG "$file: $thisList";
$thisList =~ s/[\r\n]+$//;
my @ULBEntries = split /, /, $thisList;
my @tempArray = split /, /, $thisList;
@ -221,10 +223,11 @@ sub PairtWEntriesTotWPageAndUniqSNs {
my $SNs = $1;
while ($SNs =~ s/([GH]\d*)//) {
my $thisSN = $1;
say LOG "! $shortFile ! $thisSN !";
print LOG "! $shortFile ! $thisSN !";
push @relevantSNs, $thisSN;
$entriesThisSN{$thisSN} .= "$thisList, ";
$pagesThisSN{$thisSN} .= "$shortFile, ";
say LOG " \$pagesThisSN{$thisSN}: $pagesThisSN{$thisSN}"
}
}
@ -238,7 +241,8 @@ sub PairtWEntriesTotWPageAndUniqSNs {
#say LOG "====";
#say LOG "====";
foreach my $thisSN (sort keys %entriesThisSN) {
say LOG "tW entries for $thisSN: $entriesThisSN{$thisSN}, \$pagesThisSN{$1}: $pagesThisSN{$1}"
$entriesThisSN{$thisSN} =~ s/, $//;
#say LOG "\$entriesThisSN{$thisSN}: $entriesThisSN{$thisSN}, \$pagesThisSN{$thisSN}: $pagesThisSN{$thisSN}"
}
}
@ -268,6 +272,10 @@ sub ReadLinkedSNs {
say "Reading linked Strong's numbers";
my ($flag, $sourceFile) = ("","");
foreach $sourceFile (@fileList) {
my $hg = "G";
if ($sourceFile =~ /(..)-...\.xml$/) {
$hg = "H" if ($1 < 40);
}
say LOG "opening \$sourceFile: $sourceFile";
open IN, "$sourceFile" or die "$sourceFile can't be opened\n\n";
my ($thisBook, $thisChap, $thisVers, $thisRef);
@ -275,6 +283,7 @@ sub ReadLinkedSNs {
while (<IN>) {
chomp;
if (/<verse osisID="([^\.]*).(\d+).(\d+)">/) {
#say LOG "$thisRef: \$SNsInCV{$thisRef}: $SNsInCV{$thisRef}";# Making sure previous verse is populated
my ($bk, $ch, $vs) = ($1, $2, $3);
#say LOG "#>\t$bk $ch:$vs, \$bkFull{$bk}: $bkFull{$bk}";
if (exists $newRef{"$bk $ch:$vs"}) {
@ -288,7 +297,7 @@ sub ReadLinkedSNs {
s/(lemma=").*?(\d+).*?("\n)/$1$2$3/;
while (/<w lemma="(\d+)"/g) {
#say LOG $_;
my ($thisNum) = ($1);
my ($thisNum) = ($hg . $1);
#say LOG "\t\$thisNum: $thisNum, \$SNsInCV{$thisRef}: $SNsInCV{$thisRef}";
if (exists $relevantSNs{$thisNum}) {
$SNsInCV{$thisRef} .= "$thisNum√" unless ($SNsInCV{$thisRef} =~ /\b$thisNum\b/);
@ -316,149 +325,46 @@ sub LinkSNsToULBtextViaEntries {
say "Linking Strong's numbers to ULB text via tW page entries";
say LOG "sub LinkSNsToULBtextViaEntries called";
foreach my $thisRef (sort keys %ref) {
my $tempRef = $ref{$thisRef};
say LOG "\nLinkSNsToULBtextViaEntries: \$thisRef: $thisRef\t\$ref{$thisRef}: $ref{$thisRef}, \$specifiedText{$ref{$thisRef}}: $specifiedText{$ref{$thisRef}}";
(%workEntries, %ulbOrder) = ();
my %workPage;
my ($thisCV, $checkList, $tempString, $outString) = ($ref{$thisRef}, "", "", "");
say OUT "$thisCV:";
my (@allEntries);
$listOfPages{$thisCV} = "";
#say LOG "\$SNsInCV{$thisCV}: |$SNsInCV{$thisCV}|\n$text{$thisCV}";
say LOG "\t\$SNsInCV{$thisCV}: >$SNsInCV{$thisCV}<";
$SNsInCV{$thisCV} =~ s/√+$//;
$SNsInCV{$thisCV} =~ s/^ +//;
$SNsInCV{$thisCV} =~ s/ +$//;
$SNsInCV{$thisCV} =~ s/ {2,}/ /g;
#say LOG "*\t\$SNsInCV{$thisCV}: >$SNsInCV{$thisCV}<";
if (exists $specifiedText{$thisCV}) {
#say LOG "*\t\$SNsInCV{$thisCV}: $SNsInCV{$thisCV}";
$SNsInCV{$thisCV} = Adjust($SNsInCV{$thisCV}, $thisCV);
$SNsInCV{$thisCV} =~ s/^ +(.*)/$1/;
$SNsInCV{$thisCV} =~ s/(.*) +$/$1/;
$SNsInCV{$thisCV} =~ s/ {2,}/ /g;
$SNsInCV{$thisCV} =~ s/^√+//;
$SNsInCV{$thisCV} =~ s/√{2,}/√/g;
$SNsInCV{$thisCV} =~ s/√ /√/g;
$SNsInCV{$thisCV} =~ s/√$//;
say LOG "**\t\$SNsInCV{$thisCV}: >$SNsInCV{$thisCV}<";
if (exists $deleteNum{$tempRef}) {
DeleteUnneededSNs($tempRef);
}
#say LOG "<>\t<>\t\$SNsInCV{$thisCV}: |$SNsInCV{$thisCV}|";
say LOG "*7*\t\$SNsInCV{$thisCV}:$SNsInCV{$thisCV}";
# while ($SNsInCV{$thisCV} =~ s/(\[[^\]]*?) ([^\]]*?\] )/$1√$2/) {};
say LOG "*8*\t\$SNsInCV{$thisCV}:$SNsInCV{$thisCV}";
my @tempArray = split /√/, $SNsInCV{$thisCV};
my %alreadyUsed;
my @regArray;
foreach my $slice (@tempArray) {
if ($slice =~ /^(\d*)/) {
my $number = "$1";
push (@regArray, $slice) unless (exists $alreadyUsed{$number});
$alreadyUsed{$number} = $number
}
if (exists $specifiedEntries{$tempRef}) {
AssigntWPages($tempRef, $SNsInCV{$tempRef});
}
$" = "|\n";
say LOG "*9*\t\$SNsInCV{$thisCV}:$SNsInCV{$thisCV}\n\@regArray: >@regArray<";
foreach my $thisNum (@regArray) {
say LOG "\$thisNum: $thisNum";
my ($found, $specPage);
if ($thisNum =~ /(\d+)\[(.*?)\]/) {
($thisNum) = ($1);
my ($forced_entry_for_display, $forced_entry_for_page, $forced_entry_for_search) = ($2, $2, $2);
unless (exists $pagesThisEntry{$forced_entry_for_page}) {
my $try = lc $forced_entry_for_page;
if (exists $pagesThisEntry{$try}) {
$forced_entry_for_page = lc $forced_entry_for_page
}
else {
say "!!!\tNo \$pagesThisEntry{$try} found for $try\n\$thisNum: $thisNum\t\$forced_entry_for_page: $forced_entry_for_page\n$ref{$thisRef}\t$thisNum\t$forced_entry_for_page";
#die
}
}
say LOG
"*0* \$forced_entry_for_display: $forced_entry_for_display, \$pagesThisEntry{$forced_entry_for_page}: $pagesThisEntry{$forced_entry_for_page}";
#while ($forced_entry_for_display =~ s/([^ \]]*?)√([^ \]]*?)/$1 $2/) {}
$forced_entry_for_search = lc $forced_entry_for_display;
#while ($forced_entry_for_search =~ s/ ... /\.\*\?/) {}
say LOG
"*A* \$thisNum: >>$thisNum<< \$forced_entry_for_display: >$forced_entry_for_display<,
\$forced_entry_for_search: >>$forced_entry_for_search<<
\$pagesThisEntry{$forced_entry_for_page}: $pagesThisEntry{$forced_entry_for_page}";
$outString .= "[$forced_entry_for_display]($pagesThisEntry{$forced_entry_for_page})\n";
say LOG "\t\t$outString:\n$outString";
if ($forced_entry_for_search =~ /([^,]*) \.\.\. ([^,]*) \.\.\. ([^,]*)/) {
my ($first, $second, $third) = ($1, $2, $3);
$text{$thisCV} =~ s/$first(.*?)$second(.*?)$third/$1 $2/i;
say LOG "\t*\t$text{$thisCV}";
} elsif ($forced_entry_for_search =~ /([^,]*) \.\.\. ([^,]*)/) {
my ($first, $second) = ($1, $2);
$text{$thisCV} =~ s/$first(.*?)$second/$1/i;
say LOG "\t**\t$text{$thisCV}";
} else {
#say "\$text{$thisCV}:\n$text{$thisCV}\n\$forced_entry_for_search: |$forced_entry_for_search|";
$text{$thisCV} =~ s/$forced_entry_for_search//i;
say LOG "\t***\t$text{$thisCV}";
}
next;
} elsif ($thisNum =~ /\d+(\(([\w\/]+)\))/) {
$specPage .= $2;
say LOG "*B*\t\$specPage: $specPage";
} else {
say LOG "*C*\t\$thisNum: $thisNum";
}
say LOG "\t\$specPage: $specPage";
if ($specPage) {
$workEntries{$thisNum} = $entriesThisPage{$specPage};
} else {
$workEntries{$thisNum} = $entriesThisSN{$thisNum};
}
$workEntries{$thisNum} =~ s/, $//;
say LOG "*D*\t\$thisNum: >$thisNum<\t\$workEntries{$thisNum}: >$workEntries{$thisNum}<";
my @beforeArray = split /, /, $workEntries{$thisNum};
my @sortedArray = reverse sort { substr($a,0,1) <=> substr($b,0,1)
|| length($a) <=> length($b)
|| $a <=> $b }
@beforeArray;
$" = "\n\t";
say LOG "*E*\t\@sortedArray: @sortedArray\n\$outString so far:\n$outString\n\$text{$ref{$thisRef}}: $text{$ref{$thisRef}}";
foreach my $entry (@sortedArray) {
my $testEntry = $entry;
print LOG "\$entry: $entry. Becomes ";
while ($testEntry =~ s/^(.*) \.\.\. (.*)/($1)\\b(.*?)\\b($2)/) {}
print LOG "\$testEntry: |$testEntry| ";
if ($testEntry =~ /\(\.\*\?\)/ && $text{$thisCV} =~ s/\b($testEntry)\b/$3/i) {
say LOG "\n===\n$thisNum |$testEntry| is found in first test.\n===";
$outString .= "[$entry]($pagesThisEntry{$entry})\n";
say LOG $outString . "\n===" . $text{$thisCV};
$found = 1;
goto Breakout;
} elsif ($text{$thisCV} =~ s/\b($testEntry)[^\w']//i || $text{$thisCV} =~ s/\b($testEntry)["']//i || $text{$thisCV} =~ s/["']($testEntry)\b//i) {
say LOG "\n===\n$thisNum |$testEntry| is found in second test.\n===";
$outString .= "[$entry]($pagesThisEntry{$entry})\n";
say LOG $outString . "\n" . $text{$thisCV};
$found = 1;
goto Breakout;
} else {
say LOG "and is not found in\n|$text{$ref{$thisRef}}|";
}
}
Breakout:
unless ($found) {
say MISSING "$thisCV $thisNum";
say LOG "Breakout: \$thisCV: $thisCV\t\$thisNum: $thisNum"
}
next if $found;
}
say LOG "*F*\t\$outString: $outString";
$outString = ProperOrderOutString($outString, $thisCV);
say LOG "Final \$outString:\n\$outString: $outString";
say OUT "$outString";
#say LOG "sub LinkSNsToULBtextViaEntries finished";
ReorderEntries($tempRef);
}
}
sub DeleteUnneededSNs {
my ($ref) = (@_);
say LOG "\$ref: $ref, \$SNsInCV{$ref}: $SNsInCV{$ref}, \$deleteNum{$ref}: $deleteNum{$ref}";
my @delArray = split /√/, $deleteNum{$ref};
foreach my $del (@delArray) {
$SNsInCV{$ref} =~ s/$del√//;
}
say LOG "\$ref: $ref, \$SNsInCV{$ref}: $SNsInCV{$ref}, \$deleteNum{$ref}: $deleteNum{$ref}";
}
sub AssigntWPages {
my ($ref, $SNs) = (@_);
my $tempText = $text{$ref};
say LOG "\$ref: $ref, \$SNsInCV{$ref}: $SNsInCV{$ref}, \$specifiedEntries{$ref}: $specifiedEntries{$ref}";
my @searchArray = split /√/, $SNs;
foreach my $thisSN (@searchArray) {
say LOG "\$thisSN: $thisSN\t$entriesThisSN{$thisSN}";
my @entries = split /, /, $entriesThisSN{$thisSN};
foreach my $thisEntry (@entries) {
if ($tempText =~ s/$thisEntry//) {
SortArray();
}
}
}
}
sub ReorderEntries {}
sub Adjust {
my ($snsOld, $ref, $snsNew, $addToSnsNew) = ($_[0], $_[1], "", "");
say LOG "\$specifiedText{$ref}: $specifiedText{$ref}\n\$snsOld: |$snsOld|";
@ -662,6 +568,13 @@ sub ProperOrderOutString {
return $outS;
}
sub SortArray {
my @sorted = reverse sort { substr($a,0,1) <=> substr($b,0,1)
|| length($a) <=> length($b)
|| $a <=> $b }
@array;
}
__DATA__
OT
gen Genesis