当前位置: 首页>>代码示例>>PHP>>正文


PHP Options::setLanguage方法代码示例

本文整理汇总了PHP中Options::setLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP Options::setLanguage方法的具体用法?PHP Options::setLanguage怎么用?PHP Options::setLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Options的用法示例。


在下文中一共展示了Options::setLanguage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parseOptionKeyValuePair

 private function parseOptionKeyValuePair($optionKeyValuePair)
 {
     $keyValue = explode('=', $optionKeyValuePair);
     $key = trim($keyValue[0]);
     $value = trim($keyValue[1]);
     switch ($key) {
         case 'vextwarning':
             $this->options->setVendorExtensionIssuesAsWarnings(filter_var($value, FILTER_VALIDATE_BOOLEAN));
             break;
         case 'output':
             $this->options->setOutputFormat($value);
             break;
         case 'lang':
             $this->options->setLanguage($value);
             break;
         case 'warning':
             $warningLevel = filter_var($value, FILTER_VALIDATE_INT, array('options' => array('min_range' => 0, 'default' => 2)));
             $this->options->setWarningLevel($warningLevel);
             break;
         case 'medium':
             $this->options->setMedium($value);
             break;
         case 'profile':
             $this->options->setProfile($value);
             break;
     }
 }
开发者ID:webignition,项目名称:css-validator-output-parser,代码行数:27,代码来源:Parser.php

示例2: error_reporting

<?php

/**
 * This file starts the DBpedia extraction process for abstracts.
 *
 * Warning: The script needs several days to complete on an average PC.
 */
error_reporting(E_ALL);
// automatically loads required classes
require 'dbpedia.php';
// set $extractionDir and $extractionLanguages
require 'extractionconfig.php';
$manager = new ExtractionManager();
// loop over all languages
foreach ($extractionLanguages as $currLanguage) {
    Options::setLanguage($currLanguage);
    $pageTitles = new ArticlesSqlIterator($currLanguage);
    $job = new ExtractionJob(new DatabaseWikipediaCollection($currLanguage), $pageTitles);
    $extractionDirLang = $extractionDir . '/' . $currLanguage . '/';
    if (!is_dir($extractionDirLang)) {
        mkdir($extractionDirLang);
    }
    // AbstractExtractor has references to its two destinations, see below
    $group = new ExtractionGroup(new NullDestination());
    $shortDestination = new csvNTripleDestination($extractionDirLang . "shortabstract_" . $currLanguage);
    $longDestination = new csvNTripleDestination($extractionDirLang . "longabstract_" . $currLanguage);
    $extractorInstance = new AbstractExtractor();
    $extractorInstance->setDestinations($shortDestination, $longDestination);
    $group->addExtractor($extractorInstance);
    $job->addExtractionGroup($group);
    $date = date(DATE_RFC822);
开发者ID:ljarray,项目名称:dbpedia,代码行数:31,代码来源:extract_abstracts.php

示例3: foreach

 foreach ($it as $key => $metainfo) {
     Timer::start("main::processing");
     //****PREPROCESSING*****
     //print_r($metainfo);
     $pageTitle = $metainfo['pageTitle'];
     $pageTitles = new ArrayObject(array($pageTitle));
     $pageURI = '';
     try {
         $pageURI = RDFtriple::page($pageTitle);
     } catch (Exception $e) {
         Logger::warn('main: invalid uri for ' . $pageTitle);
         continue;
     }
     Logger::info("Title:  {$pageTitle} " . mb_detect_encoding($pageTitle) . "");
     $language = $metainfo['language'];
     Options::setLanguage($language);
     $lastarticlestmp[] = $pageURI->getURI();
     $metainfo['oaiidentifier'] = $metainfo['oaiId'];
     $metainfo['oaiId'] = Util::getOaiIDfromIdentifier($language, $metainfo['oaiidentifier']);
     Logger::info("oaiId " . $metainfo['oaiId']);
     //***MAINTAINANCE***
     $count++;
     //log statistics
     if ($count % Options::getOption('printStatInterval') == 0) {
         printAll($lastarticles, $language);
     }
     //50 last articles to statisticdir
     if ($count < 50) {
         $lastarticles = $lastarticlestmp;
     }
     if ($count % 50 == 0) {
开发者ID:nsystem1,项目名称:ZeeJong,代码行数:31,代码来源:extract_live.php

示例4: KoInfoboxExtractor

 * the LiveWikipedia. The file outputs the generated triples 
 * directly. This is the best way for developers to verify that
 * their extractors are working. Once the extractor is working on
 * an article, developers should use extract_dataset to produce a
 * full data set and see whether it works in a full extraction.
 *
 * See http://wiki.dbpedia.org/Documentation for an overview of
 * the DBpedia extraction framework.
 *
 * @author Jens Lehmann
 */
include 'dbpedia.php';
// configure settings
// change the Extractor class to your extractor
//this should be done in config/dbpedia.ini
Options::setLanguage('ko');
$language = Options::getOption('language');
//$extractor = new ActiveAbstractExtractor();
$extractor = new KoInfoboxExtractor();
/*
$extractor = new InfoboxExtractor();
*/
//$extractor = new SkosCategoriesExtractor();
//these are articles for testing
//$article[] = 'London';
//$article[] = 'Category:Pasta';
$t = '이탈리아';
$t = '서울특별시';
/*
$t = 'Berlin';
*/
开发者ID:ljarray,项目名称:dbpedia,代码行数:31,代码来源:extract_test.php


注:本文中的Options::setLanguage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。