diff --git a/FragmentLoader.php b/FragmentLoader.php index 7ad7f73..f904f0f 100644 --- a/FragmentLoader.php +++ b/FragmentLoader.php @@ -50,31 +50,31 @@ class FragmentLoader { static public function getFragments(&$ignored = array()) { - $entries = WikiLoader::getEntriesWithPrefix('Skm/Fragment', true, true); + $entries = WikiLoader::getEntriesWithPrefix('Fiesh/GC/Fragment', true, true); return self::processFrags($entries, $ignored); } - static public function getFragmentsKM2001(&$ignored = array()) - { - $entries = WikiLoader::getEntriesWithPrefix('Skm/Koch-Mehrin-2001/', true, true); - $fragmentTitles = array(); - foreach($entries as $e) { - if(preg_match('/^Skm/Koch-Mehrin-2001\/(\d{3})$/', $e['title'], $match) && $match[1] >= 1) { - $pagenum = (int) $match[1]; - $raw = $e['revisions'][0]['*']; - $raw = preg_replace('//s', '', $raw); - preg_match_all('/\{\{:([- _A-Za-z0-9\/]*?)\}\}/', $raw, $match); - $i = 0; - while(isset($match[1][$i])) { - $fragmentTitles[] = str_replace('_', ' ', $match[1][$i]); - ++$i; - } - } - } + # static public function getFragmentsKM2001(&$ignored = array()) + # { + # $entries = WikiLoader::getEntriesWithPrefix('Skm/Koch-Mehrin-2001/', true, true); + # $fragmentTitles = array(); + # foreach($entries as $e) { + # if(preg_match('/^Skm/Koch-Mehrin-2001\/(\d{3})$/', $e['title'], $match) && $match[1] >= 1) { + # $pagenum = (int) $match[1]; + # $raw = $e['revisions'][0]['*']; + # $raw = preg_replace('//s', '', $raw); + # preg_match_all('/\{\{:([- _A-Za-z0-9\/]*?)\}\}/', $raw, $match); + # $i = 0; + # while(isset($match[1][$i])) { + # $fragmentTitles[] = str_replace('_', ' ', $match[1][$i]); + # ++$i; + # } + # } + # } - $fragmentEntries = WikiLoader::getEntriesByTitles($fragmentTitles); - return self::processFrags($fragmentEntries, $ignored); - } + # $fragmentEntries = WikiLoader::getEntriesByTitles($fragmentTitles); + # return self::processFrags($fragmentEntries, $ignored); + # } static private function parseFragmentType($rawText) { diff --git a/WikiLoader.php b/WikiLoader.php index e1cca9d..93f4a21 100644 --- a/WikiLoader.php +++ b/WikiLoader.php @@ -9,7 +9,7 @@ class WikiLoader { static private function queryPrefixList($prefix, $ignoreRedirects = false) { - $url = self::API.'?action=query&prop=&format=php&generator=allpages&gaplimit=500&gapprefix='.urlencode($prefix); + $url = self::API.'?action=query&prop=&format=php&generator=allpages&gaplimit=500&gapnamespace=2&gapprefix='.urlencode($prefix); if ($ignoreRedirects) $url .= '&gapfilterredir=nonredirects'; diff --git a/buildcache.php b/buildcache.php index 32c91f4..31f8b8c 100644 --- a/buildcache.php +++ b/buildcache.php @@ -54,10 +54,10 @@ $cache['fragmenttypes'] = FragmentLoader::getFragmentTypes($ignoredFragmentTypes print "fertig!\n"; # Quellen laden -print "Lade Quellen... "; flush(); -$ignoredSources = array(); -$cache['sources'] = BibliographyLoader::getSources($ignoredSources); -print "fertig!\n"; +#print "Lade Quellen... "; flush(); +#$ignoredSources = array(); +#$cache['sources'] = BibliographyLoader::getSources($ignoredSources); +#print "fertig!\n"; # Entwurf laden print "Lade Entwurf... "; flush(); diff --git a/skm-overlay.php b/skm-overlay.php index 5292668..acdc5d5 100644 --- a/skm-overlay.php +++ b/skm-overlay.php @@ -1269,32 +1269,35 @@ function filterTextWords($textwords, $only_footnotes) { } function kochMehrinMustFilter($textpage) { - return $textpage->label != 58 && $textpage->label != 59 - && $textpage->label != 69; + return False; +# return $textpage->label != 58 && $textpage->label != 59 +# && $textpage->label != 69; } function kochMehrinMustScale($textpage) { - return $textpage->getPaperType() != "A5 Portrait"; + return False; +# return $textpage->getPaperType() != "A5 Portrait"; } function kochMehrinScale($textwords, $textpage) { - $result = array(); - if ($textpage->label % 2 == 0) { - $xshift = -39.5; - $yshift = -52.0; - } else { - $xshift = -31.5; - $yshift = -50.5; - } - foreach ($textwords as $textword) { - $newtextword = clone $textword; - $newtextword->xMin += $xshift; - $newtextword->yMin += $yshift; - $newtextword->xMax += $xshift; - $newtextword->yMax += $yshift; - $result[] = $newtextword; - } - return $result; +return $textwords; +# $result = array(); +# if ($textpage->label % 2 == 0) { +# $xshift = -39.5; +# $yshift = -52.0; +# } else { +# $xshift = -31.5; +# $yshift = -50.5; +# } +# foreach ($textwords as $textword) { +# $newtextword = clone $textword; +# $newtextword->xMin += $xshift; +# $newtextword->yMin += $yshift; +# $newtextword->xMax += $xshift; +# $newtextword->yMax += $yshift; +# $result[] = $newtextword; +# } +# return $result; } function longestCommonSubsequence($x, $y) { @@ -1494,11 +1497,11 @@ foreach($cache['fragmenttypes'] as $fragtype) { } # Textpositionen laden -if(!file_exists('Koch-Mehrin.xml')) { - print "Fehler: Koch-Mehrin.xml existiert nicht!\n"; +if(!file_exists('0140.xml')) { + print "Fehler: 0140.xml existiert nicht!\n"; exit(1); } -$textpages = parseTextPageFragments("Koch-Mehrin.xml"); +$textpages = parseTextPageFragments("0140.xml"); cleanupTextPageFragments($textpages); $pdfpagenums = getPDFPageNums($textpages);