-
Notifications
You must be signed in to change notification settings - Fork 8
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
1 parent
4c8b25b
commit 9605edd
Showing
9 changed files
with
371 additions
and
29 deletions.
There are no files selected for viewing
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
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,104 @@ | ||
<?php | ||
include 'function.php'; | ||
include 'slp-dev.php'; | ||
$data = file('../sutrarelations/difflog2.txt'); | ||
$data = array_map('trim',$data); | ||
|
||
function sutradisplay($sutra_number) | ||
{ | ||
global $ASdata, $vdata, $miscdata, $paribhASAdata; global $upasarga_joined; global $us, $outfile, $otherdata; // bringing $text from main php function. | ||
$output = ''; | ||
if (strpos($sutra_number,'~')!==false) | ||
{ | ||
$matches = array_filter($otherdata, function($var) use ($sutra_number) { return strpos($var,$sutra_number.":")!==false; }); | ||
$matches=array_values($matches); | ||
$int = explode(':',$matches[0]); // We presume that there would be only one match. | ||
$msg_no = $int[0]; | ||
$msg_dev = $int[2]; | ||
if ($msg_no === $sutra_number) | ||
{ | ||
$output = $msg_dev; | ||
} | ||
} | ||
elseif (strpos($sutra_number,'@')!==false) | ||
{ | ||
$matches = array_filter($paribhASAdata, function($var) use ($sutra_number) { return strpos($var,$sutra_number.":")!==false; }); | ||
$matches=array_values($matches); | ||
$int = explode(':',$matches[0]); // We presume that there would be only one match. | ||
$msg_no = $int[0]; | ||
$msg_dev = $int[2]; | ||
if ($msg_no === $sutra_number) | ||
{ | ||
$output = $msg_dev[$i]; | ||
} | ||
} | ||
elseif (strpos($sutra_number,'-')===false && strpos($sutra_number,'.')!==false) | ||
{ | ||
$matches = array_filter($ASdata, function($var) use ($sutra_number) { return strpos($var,$sutra_number.":")!==false; }); | ||
$matches=array_values($matches); | ||
$int = explode(':',$matches[0]); // We presume that there would be only one such match. | ||
$sutra_no = $int[0]; | ||
$sutra_dev = $int[2]; | ||
if ($sutra_no === $sutra_number) | ||
{ | ||
$output = $sutra_dev; | ||
} | ||
} | ||
elseif (strpos($sutra_number,'-')!==false && strpos($sutra_number,'.')!==false) | ||
{ | ||
$matches = array_filter($vdata, function($var) use ($sutra_number) { return strpos($var,$sutra_number.":")!==false; }); | ||
$matches=array_values($matches); | ||
$int = explode(':',$matches[0]); | ||
$vartika_no = $int[0]; | ||
$sutra_dev = $int[1]; | ||
if ($vartika_no === $sutra_number) | ||
{ | ||
$output = convert($sutra_dev); | ||
} | ||
} | ||
else | ||
{ | ||
$matches = array_filter($miscdata, function($var) use ($sutra_number) { return strpos($var,$sutra_number.":")!==false; }); | ||
$matches=array_values($matches); | ||
$int = explode(':',$matches[0]); | ||
$vartika_no = $int[0]; | ||
$sutra_dev = $int[1]; | ||
if ($vartika_no === $sutra_number) | ||
{ | ||
$output = convert($sutra_dev); | ||
} | ||
} | ||
if (isset($output) && $output!=='') | ||
{ | ||
return $output."(".link_sutra($sutra_number,'..').")"; | ||
} | ||
else | ||
{ | ||
return "-----"; | ||
} | ||
} | ||
|
||
|
||
foreach($data as $datum) | ||
{ | ||
$parts = explode(':',$datum); | ||
echo convert($parts[1])."-".convert($parts[2])."<br/>\n"; | ||
echo "If rule <b>".sutradisplay($parts[0])." didn't exist</b>, the following rules would <b>not have applied</b>.<br/>\n"; | ||
$barredsutras = explode(',',$parts[3]); | ||
$barr = array(); | ||
foreach ($barredsutras as $bar) | ||
{ | ||
$barr[] = sutradisplay($bar); | ||
} | ||
echo implode(', ',$barr)."<br/>\n"; | ||
echo "If rule <b>".sutradisplay($parts[0])." didn't exist</b>, the following new rules <b>would have applied</b>.<br/>\n"; | ||
$newsutras = explode(',',$parts[4]); | ||
$neww = array(); | ||
foreach ($newsutras as $new) | ||
{ | ||
$neww[] = sutradisplay($new); | ||
} | ||
echo implode(', ',$neww)."<br/>\n"; | ||
echo "<hr/>\n"; | ||
} | ||
?> |
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,3 @@ | ||
3.1.68:BU:law:3.4.113,3.1.68,1.3.8,7.3.84,6.1.78,6.1.97,7.3.101:7.3.88,6.4.77,8.3.55,8.3.57,8.3.59 | ||
3.1.68:BU:law:3.4.113,3.1.68,1.3.8,7.3.84,6.1.78,6.1.97,7.3.101:7.3.88,6.4.77,8.3.55,8.3.57,8.3.59 | ||
3.1.68:BU:law:3.4.113,3.1.68,1.3.8,7.3.84,6.1.78,6.1.97,7.3.101:7.3.88,6.4.77,8.3.55,8.3.57,8.3.59 |
Oops, something went wrong.