本文整理汇总了PHP中Definition::stripNumberSign方法的典型用法代码示例。如果您正苦于以下问题:PHP Definition::stripNumberSign方法的具体用法?PHP Definition::stripNumberSign怎么用?PHP Definition::stripNumberSign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Definition
的用法示例。
在下文中一共展示了Definition::stripNumberSign方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseOneDefinition
/** Parses one definition line, i.e. extracts {{label}}, definition,
* {{example|Quotation sentence.}}, creates and fills a meaning (WMeaning).
* @param page_title word which is described in this article 'text'
* @param lang_section language of this section of an article
* @param line definition line
* @return WMeaning or null if the line is not started from "#" or = "# "
*/
public static function parseOneDefinition($page_title, $lang_section, $line)
{
if (preg_match("/\\{\\{Нужен перевод\\}\\}/", $line)) {
return null;
}
// remove empty quotations: {{пример|}} and {{пример}}
$line = preg_replace("/\\{\\{пример\\|\\}\\}/", "", $line);
$line = preg_replace("/\\{\\{пример\\}\\}/", "", $line);
$line = preg_replace("/\\{\\{пример перевод\\|\\}\\}/", "", $line);
// todo check - does exist this example
$line = preg_replace("/\\[\\[\\]\\]/", "", $line);
// empty definition
$line = Definition::stripNumberSign($page_title, $line);
if (0 == strlen($line)) {
return null;
}
if (preg_match("/\\A\\{\\{морфема/", $line)) {
return null;
}
// skip now, todo (parse) in future
$label_text = LabelRu . extractLabelsTrimText(line);
if (null == label_text) {
return null;
}
/*
$line = label_text.getText();
// 2. extract text till first {{пример|
String wiki_definition = WQuoteRu.getDefinitionBeforeFirstQuote(page_title, line);
// 3. parsing wiki-text
//StringBuffer definition = WikiWord.parseDoubleBrackets(page_title, new StringBuffer(wiki_definition));
// 4. extract wiki-links (internal links)
//WikiWord[] ww = WikiWord.getWikiWords(page_title, new StringBuffer(wiki_definition));
// 5. extract quotations
WQuote[] quote = WQuoteRu.getQuotes(page_title, line);
return new WMeaning(page_title, label_text.getLabels(), wiki_definition, quote, false);
*/
}