View source
<?php
class PARSEENTRIES {
function PARSEENTRIES() {
$this->transtab_latex_unicode = $this
->get_transtab_latex_unicode();
$this->preamble = $this->strings = $this->undefinedStrings = $this->entries = array();
$this->count = 0;
$this->fieldExtract = TRUE;
$this->removeDelimit = TRUE;
$this->expandMacro = FALSE;
$this->parseFile = TRUE;
$this->outsideEntry = TRUE;
$this->translate_latex = TRUE;
}
function openBib($file) {
if (!is_file($file)) {
die;
}
ini_set('auto_detect_line_endings', true);
$this->fid = fopen($file, 'r');
$this->parseFile = TRUE;
}
function loadBibtexString($bibtex_string) {
if (is_string($bibtex_string)) {
$this->bibtexString = explode("\n", $bibtex_string);
}
else {
$this->bibtexString = $bibtex_string;
}
$this->parseFile = FALSE;
$this->currentLine = 0;
}
function searchReplaceText($searchReplaceActionsArray, $sourceString, $includesSearchPatternDelimiters = FALSE) {
$searchStrings = array_keys($searchReplaceActionsArray);
if (!$includesSearchPatternDelimiters) {
foreach ($searchStrings as $key => $value) {
$searchStrings[$key] = "/" . $value . "/";
}
}
$replaceStrings = array_values($searchReplaceActionsArray);
return preg_replace($searchStrings, $replaceStrings, $sourceString);
}
function loadStringMacro($macro_array) {
$this->userStrings = $macro_array;
}
function closeBib() {
fclose($this->fid);
}
function getLine() {
if ($this->parseFile) {
if (!feof($this->fid)) {
do {
$line = trim(fgets($this->fid));
} while (!feof($this->fid) && !$line);
return $line;
}
return FALSE;
}
else {
do {
$line = array_shift($this->bibtexString);
$line = trim($line);
$this->currentLine++;
} while ($this->bibtexString && !$line);
return $line;
}
}
function extractStringValue($string) {
$string = trim(substr($string, 0, strlen($string) - 1));
$string = $this
->removeDelimitersAndExpand($string);
return $string;
}
function fieldSplit($seg) {
$array = preg_split("/,\\s*([-_.:,a-zA-Z0-9]+)\\s*={1}\\s*/U", $seg, PREG_SPLIT_DELIM_CAPTURE);
if (!array_key_exists(1, $array)) {
return array(
$array[0],
FALSE,
);
}
return array(
$array[0],
$array[1],
);
}
function reduceFields($oldString) {
$lg = strlen($oldString);
if ($oldString[$lg - 1] == "}" || $oldString[$lg - 1] == ")" || $oldString[$lg - 1] == ",") {
$oldString = substr($oldString, 0, $lg - 1);
}
$split = preg_split("/=/", $oldString, 2);
$string = $split[1];
while ($string) {
list($entry, $string) = $this
->fieldSplit($string);
$values[] = $entry;
}
foreach ($values as $value) {
$pos = strpos($oldString, $value);
$oldString = substr_replace($oldString, '', $pos, strlen($value));
}
$rev = strrev(trim($oldString));
if ($rev[0] != ',') {
$oldString .= ',';
}
$keys = preg_split("/=,/", $oldString);
array_pop($keys);
foreach ($keys as $key) {
$value = trim(array_shift($values));
$rev = strrev($value);
if ($rev[0] == ',') {
$value = rtrim($value, ",");
}
if (!$value) {
continue;
}
$key = strtolower(trim($key));
$value = trim($value);
$this->entries[$this->count][$key] = $value;
}
}
function fullSplit($entry) {
$matches = preg_split("/@(.*)[{(](.*),/U", $entry, 2, PREG_SPLIT_DELIM_CAPTURE);
$this->entries[$this->count]['bibtexEntryType'] = strtolower(trim($matches[1]));
if (preg_match("/=/", $matches[2])) {
$matches = preg_split("/@(.*)\\s*[{(](.*)/U", $entry, 2, PREG_SPLIT_DELIM_CAPTURE);
}
$this->entries[$this->count]['bibtexCitation'] = $matches[2];
$this
->reduceFields($matches[3]);
}
function parseEntry($entry) {
set_time_limit(30);
$entry = $this->translate_latex ? $this
->searchReplaceText($this->transtab_latex_unicode, $entry, FALSE) : $entry;
$count = 0;
$lastLine = FALSE;
if (preg_match("/@(.*)([{(])/U", preg_quote($entry), $matches)) {
if (!array_key_exists(1, $matches)) {
return $lastLine;
}
if (preg_match("/string/i", trim($matches[1]))) {
$this->strings[] = $entry;
}
else {
if (preg_match("/preamble/i", trim($matches[1]))) {
$this->preamble[] = $entry;
}
else {
if (preg_match("/comment/i", $matches[1])) {
}
else {
if ($this->fieldExtract) {
$this
->fullSplit($entry);
}
else {
$this->entries[$this->count] = $entry;
}
$this->count++;
}
}
}
return $lastLine;
}
}
function removeDelimiters($string) {
if ($string && $string[0] == "\"") {
$string = substr($string, 1);
$string = substr($string, 0, -1);
}
else {
if ($string && $string[0] == "{") {
if (strlen($string) > 0 && $string[strlen($string) - 1] == "}") {
$string = substr($string, 1);
$string = substr($string, 0, -1);
}
}
else {
if (!is_numeric($string) && !array_key_exists($string, $this->strings) && array_search($string, $this->undefinedStrings) === FALSE) {
$this->undefinedStrings[] = $string;
return '';
}
}
}
return $string;
}
function explodeString($val) {
$openquote = $bracelevel = $i = $j = 0;
while ($i < strlen($val)) {
if ($val[$i] == '"') {
$openquote = !$openquote;
}
elseif ($val[$i] == '{') {
$bracelevel++;
}
elseif ($val[$i] == '}') {
$bracelevel--;
}
elseif ($val[$i] == '#' && !$openquote && !$bracelevel) {
$strings[] = substr($val, $j, $i - $j);
$j = $i + 1;
}
$i++;
}
$strings[] = substr($val, $j);
return $strings;
}
function closingDelimiter($val, $delimitEnd) {
$openquote = $bracelevel = $i = $j = 0;
while ($i < strlen($val)) {
if ($val[$i] == '"' && !$bracelevel) {
$openquote = !$openquote;
}
elseif ($val[$i] == '{') {
$bracelevel++;
}
elseif ($val[$i] == '}') {
$bracelevel--;
}
if ($val[$i] == $delimitEnd && !$openquote && !$bracelevel) {
return $i;
}
$i++;
}
return 0;
}
function removeDelimitersAndExpand($string, $inpreamble = FALSE) {
if (!$this->expandMacro || empty($this->strings) || $inpreamble) {
$string = $this
->removeDelimiters($string);
}
else {
$stringlist = $this
->explodeString($string);
$string = "";
foreach ($stringlist as $str) {
$str = trim($str);
if (isset($this->strings[strtolower($str)])) {
$string .= $this->strings[strtolower($str)];
}
else {
$string .= $this
->removeDelimiters(trim($str));
}
}
}
return $string;
}
function extractEntries() {
$inside = $possibleEntryStart = FALSE;
$entry = "";
while ($line = $this
->getLine()) {
if ($possibleEntryStart) {
$line = $possibleEntryStart . $line;
}
if (!$inside && strchr($line, "@")) {
$line = strstr($line, '@');
if (!strchr($line, "{") && !strchr($line, "(")) {
$possibleEntryStart = $line;
}
elseif (preg_match("/@.*([{(])/U", preg_quote($line), $matches)) {
$inside = TRUE;
if ($matches[1] == '{') {
$delimitEnd = '}';
}
else {
$delimitEnd = ')';
}
$possibleEntryStart = FALSE;
}
}
if ($inside) {
$entry .= " " . $line;
if ($j = $this
->closingDelimiter($entry, $delimitEnd)) {
$lastLine = substr($entry, $j + 1);
$entry = substr($entry, 0, $j + 1);
$entry = preg_replace('/\\s\\s+/', ' ', $entry);
$this
->parseEntry($entry);
$entry = strchr($lastLine, "@");
if ($entry) {
$inside = TRUE;
}
else {
$inside = FALSE;
}
}
}
}
}
function returnArrays() {
foreach ($this->preamble as $value) {
preg_match("/.*?[{(](.*)/", $value, $matches);
$preamble = substr($matches[1], 0, -1);
$preambles['bibtexPreamble'] = trim($this
->removeDelimitersAndExpand(trim($preamble), TRUE));
}
if (isset($preambles)) {
$this->preamble = $preambles;
}
if ($this->fieldExtract) {
$strings = $this->strings;
$this->strings = isset($this->userStrings) ? $this->userStrings : array();
foreach ($strings as $value) {
$value = trim($value);
$matches = preg_split("/@\\s*string\\s*([{(])/i", $value, 2, PREG_SPLIT_DELIM_CAPTURE);
$delimit = $matches[1];
$matches = preg_split("/=/", $matches[2], 2, PREG_SPLIT_DELIM_CAPTURE);
$this->strings[strtolower(trim($matches[0]))] = $this
->extractStringValue($matches[1]);
}
}
if ($this->removeDelimit || $this->expandMacro && $this->fieldExtract) {
for ($i = 0; $i < count($this->entries); $i++) {
foreach ($this->entries[$i] as $key => $value) {
if ($key != 'bibtexCitation' && $key != 'bibtexEntryType') {
$this->entries[$i][$key] = trim($this
->removeDelimitersAndExpand($this->entries[$i][$key]));
}
}
}
}
return array(
$this->preamble,
$this->strings,
$this->entries,
$this->undefinedStrings,
);
}
function &getEntries() {
if ($this->removeDelimit || $this->expandMacro && $this->fieldExtract) {
for ($i = 0; $i < count($this->entries); $i++) {
foreach ($this->entries[$i] as $key => $value) {
if ($key != 'bibtexCitation' && $key != 'bibtexEntryType') {
$this->entries[$i][$key] = trim($this
->removeDelimitersAndExpand($this->entries[$i][$key]));
}
}
}
}
return $this->entries;
}
public function get_transtab_latex_unicode() {
return array(
'\\$\\\\#\\$' => "#",
"\\\\%" => "%",
"\\\\&" => "&",
"(?<!\\\\)~" => " ",
"\\{\\\\textexclamdown\\}" => "¡",
"\\{\\\\textcent\\}" => "¢",
"\\{\\\\textsterling\\}" => "£",
"\\{\\\\textyen\\}" => "¥",
"\\{\\\\textbrokenbar\\}" => "¦",
"\\{\\\\textsection\\}" => "§",
"\\{\\\\textasciidieresis\\}" => "¨",
"\\{\\\\textcopyright\\}" => "©",
"\\{\\\\textordfeminine\\}" => "ª",
"\\{\\\\guillemotleft\\}" => "«",
"\\{\\\\textlnot\\}" => "¬",
"\\{\\\\textregistered\\}" => "®",
"\\{\\\\textasciimacron\\}" => "¯",
"\\{\\\\textdegree\\}" => "°",
"\\{\\\\textpm\\}" => "±",
"\\{\\\\texttwosuperior\\}" => "²",
"\\{\\\\textthreesuperior\\}" => "³",
"\\{\\\\textasciiacute\\}" => "´",
"\\{\\\\textmu\\}" => "µ",
"\\{\\\\textparagraph\\}" => "¶",
"\\{\\\\textperiodcentered\\}" => "·",
"\\{\\\\c\\\\ \\}" => "¸",
"\\{\\\\textonesuperior\\}" => "¹",
"\\{\\\\textordmasculine\\}" => "º",
"\\{\\\\guillemotright\\}" => "»",
"\\{\\\\textonequarter\\}" => "¼",
"\\{\\\\textonehalf\\}" => "½",
"\\{\\\\textthreequarters\\}" => "¾",
"\\{\\\\textquestiondown\\}" => "¿",
"\\{?\\\\`\\{?A\\}?\\}?" => "À",
"\\{?\\\\'\\{?A\\}?\\}?" => "Á",
"\\{?\\\\\\^\\{?A\\}?\\}?" => "Â",
"\\{?\\\\~\\{?A\\}?\\}?" => "Ã",
"\\{?\\\\\"\\{?A\\}?\\}?" => "Ä",
"\\{?\\\\r\\s\\{?A\\}?\\}?" => "Å",
"\\{?\\\\AE\\}?" => "Æ",
"\\{?\\\\c\\sC\\}?" => "Ç",
"\\{?\\\\`\\{?E\\}?\\}?" => "È",
"\\{?\\\\'\\{?E\\}?\\}?" => "É",
"\\{?\\\\\\^\\{?E\\}?\\}?" => "Ê",
"\\{?\\\\\"\\{?E\\}?\\}?" => "Ë",
"\\{?\\\\`\\{?I\\}?\\}?" => "Ì",
"\\{?\\\\'\\{?I\\}?\\}?" => "Í",
"\\{?\\\\\\^\\{?I\\}?\\}?" => "Î",
"\\{?\\\\\"\\{?I\\}?\\}?" => "Ï",
"\\{?\\\\DH\\}?" => "Ð",
"\\{?\\\\~\\{?N\\}?\\}?" => "Ñ",
"\\{?\\\\`\\{?O\\}?\\}?" => "Ò",
"\\{?\\\\'\\{?O\\}?\\}?" => "Ó",
"\\{?\\\\\\^\\{?O\\}?\\}?" => "Ô",
"\\{?\\\\~\\{?O\\}?\\}?" => "Õ",
"\\{?\\\\\"\\{?O\\}?\\}?" => "Ö",
"\\{?\\\\texttimes\\}?" => "×",
"\\{?\\\\O\\}?" => "Ø",
"\\{?\\\\`\\{?U\\}?\\}?" => "Ù",
"\\{?\\\\'\\{?U\\}?\\}?" => "Ú",
"\\{?\\\\\\^\\{?U\\}?\\}?" => "Û",
"\\{?\\\\\"\\{?U\\}?\\}?" => "Ü",
"\\{?\\\\'\\{?Y\\}?\\}?" => "Ý",
"\\{?\\\\TH\\}?" => "Þ",
"\\{?\\\\ss\\{?\\}?\\}?" => "ß",
"\\{?\\\\`\\{?a\\}?\\}?" => "à",
"\\{?\\\\'\\{?a\\}?\\}?" => "á",
"\\{?\\\\\\^\\{?a\\}?\\}?" => "â",
"\\{?\\\\~\\{?a\\}?\\}?" => "ã",
"\\{?\\\\\"\\{?a\\}?\\}?" => "ä",
"\\{?\\\\r\\s\\{?a\\}?\\}?" => "å",
"\\{?\\\\ae\\}?" => "æ",
"\\{?\\\\c\\{?c\\}?\\}?" => "ç",
"\\{?\\\\`\\{?e\\}?\\}?" => "è",
"\\{?\\\\'\\{?e\\}?\\}?" => "é",
"\\{?\\\\\\^\\{?e\\}?\\}?" => "ê",
"\\{?\\\\\"\\s?\\{?e\\}?\\}?" => "ë",
"\\{?\\\\`\\{?i\\}?\\}?" => "ì",
"\\{?\\\\'\\{?i\\}?\\}?" => "í",
"\\{?\\\\\\^\\{?i\\}?\\}?" => "î",
"\\{?\\\\\"\\{?i\\}?\\}?" => "ï",
"\\{?\\\\dh\\}?" => "ð",
"\\{?\\\\~\\{?n\\}?\\}?" => "ñ",
"\\{?\\\\`\\{?o\\}?\\}?" => "ò",
"\\{?\\\\'\\{?o\\}?\\}?" => "ó",
"\\{?\\\\\\^\\{?o\\}?\\}?" => "ô",
"\\{?\\\\~\\{?o\\}?\\}?" => "õ",
"\\{?\\\\\"\\{?o\\}?\\}?" => "ö",
"\\{?\\\\textdiv\\}?" => "÷",
"\\{?\\\\o\\}?" => "ø",
"\\{?\\\\`\\{?u\\}?\\}?" => "ù",
"\\{?\\\\'\\{?u\\}?\\}?" => "ú",
"\\{?\\\\\\^\\{?u\\}?\\}?" => "û",
"\\{?\\\\\"\\{?u\\}?\\}?" => "ü",
"\\{?\\\\'\\{?y\\}?\\}?" => "ý",
"\\{?\\\\th\\}?" => "þ",
"\\{?\\\\\"\\{?y\\}?\\}?" => "ÿ",
"\\{?\\\\u\\{?A\\}?\\}?" => "Ă",
"\\{?\\\\u\\{?a\\}?\\}?" => "ă",
"\\{?\\\\k\\{?a\\}?\\}?" => "ą",
"\\{?\\\\'\\{?C\\}?\\}?" => "Ć",
"\\{?\\\\'\\{?c\\}?\\}?" => "ć",
"\\{?\\\\v\\{?C\\}?\\}?" => "Č",
"\\{?\\\\v\\{?c\\}?\\}?" => "č",
"\\{?\\\\v\\{?c\\}?\\}?" => "č",
"\\{?\\\\v\\{?D\\}?\\}?" => "Ď",
"\\{?\\\\v\\{?d\\}?\\}?" => "ď",
"\\{?\\\\DJ\\}?" => "Đ",
"\\{?\\\\dj\\}?" => "đ",
"\\{?\\\\k\\{?E\\}?\\}?" => "Ę",
"\\{?\\\\k\\{?e\\}?\\}?" => "ę",
"\\{?\\\\v\\{?E\\}?\\}?" => "Ě",
"\\{?\\\\v\\{?e\\}?\\}?" => "ě",
"\\{?\\\\u\\s?\\{?e\\}?\\}?" => "ĕ",
"\\{?\\\\u\\{?G\\}?\\}?" => "Ğ",
"\\{?\\\\u\\{?g\\}?\\}?" => "ğ",
"\\{?\\\\.\\{?g\\}?\\}?" => "ġ",
"\\{?\\\\.\\{?I\\}?\\}?" => "İ",
"\\{?\\\\i\\}?" => "ı",
"\\{?\\\\'\\{?L\\}?\\}?" => "Ĺ",
"\\{?\\\\v\\{?L\\}?\\}?" => "Ľ",
"\\{?\\\\v\\{?l\\}?\\}?" => "ľ",
"\\{?\\\\L\\}?" => "Ł",
"\\{?\\\\l\\}?" => "ł",
"\\{?\\\\'\\{?N\\}?\\}?" => "Ń",
"\\{?\\\\'\\{?n\\}?\\}?" => "ń",
"\\{?\\\\v\\{?N\\}?\\}?" => "Ň",
"\\{?\\\\v\\{?n\\}?\\}?" => "ň",
"\\{?\\\\NG\\}?" => "Ŋ",
"\\{?\\\\ng\\}?" => "ŋ",
"\\{?\\\\H\\{?O\\}?\\}?" => "Ő",
"\\{?\\\\H\\{?o\\}?\\}?" => "ő",
"\\{?\\\\OE\\}?" => "Œ",
"\\{?\\\\oe\\}?" => "œ",
"\\{?\\\\'\\{?R\\}?\\}?" => "Ŕ",
"\\{?\\\\'\\{?r\\}?\\}?" => "ŕ",
"\\{?\\\\v\\{?R\\}?\\}?" => "Ř",
"\\{?\\\\v\\{?r\\}?\\}?" => "ř",
"\\{?\\\\'\\{?S\\}?\\}?" => "Ś",
"\\{?\\\\'\\{?s\\}?\\}?" => "ś",
"\\{?\\\\c\\{?S\\}?\\}?" => "Ş",
"\\{?\\\\c\\{?s\\}?\\}?" => "ş",
"\\{?\\\\v\\{?S\\}?\\}?" => "Š",
"\\{?\\\\v\\{?s\\}?\\}?" => "š",
"\\{?\\\\c\\{?T\\}?\\}?" => "Ţ",
"\\{?\\\\c\\{?t\\}?\\}?" => "ţ",
"\\{?\\\\v\\{?T\\}?\\}?" => "Ť",
"\\{?\\\\v\\{?t\\}?\\}?" => "ť",
"\\{?\\\\r\\{?U\\}?\\}?" => "Ů",
"\\{?\\\\r\\{?u\\}?\\}?" => "ů",
"\\{?\\\\H\\{?U\\}?\\}?" => "Ű",
"\\{?\\\\H\\{?u\\}?\\}?" => "ű",
"\\{?\\\\\"\\{?Y\\}?\\}?" => "Ÿ",
"\\{?\\\\'\\{?Z\\}?\\}?" => "Ź",
"\\{?\\\\'\\{?z\\}?\\}?" => "ź",
"\\{?\\\\.\\{?Z\\}?\\}?" => "Ż",
"\\{?\\\\.\\{?z\\}?\\}?" => "ż",
"\\{?\\\\v\\{?Z\\}?\\}?" => "Ž",
"\\{?\\\\v\\{?z\\}?\\}?" => "ž",
"\\{?\\\\textflorin\\}?" => "ƒ",
"\\{?\\\\textasciicircum\\}?" => "ˆ",
"\\{?\\\\textacutedbl\\}?" => "˝",
"\\{?\\\\textendash\\}?|--" => "–",
"\\{?\\\\textemdash\\}?|---" => "—",
"\\{?\\\\textbardbl\\}?" => "‖",
"\\{?\\\\textunderscore\\}?" => "‗",
"\\{?\\\\textquoteleft\\}?" => "‘",
"\\{?\\\\textquoteright\\}?" => "’",
"\\{?\\\\quotesinglbase\\}?" => "‚",
"\\{?\\\\textquotedblleft\\}?" => "“",
"\\{?\\\\textquotedblright\\}?" => "”",
"\\{?\\\\quotedblbase\\}?" => "„",
"\\{?\\\\textdagger\\}?" => "†",
"\\{?\\\\textdaggerdbl\\}?" => "‡",
"\\{?\\\\textbullet\\}?" => "•",
"\\{?\\\\textellipsis\\}?" => "…",
"\\{?\\\\textperthousand\\}?" => "‰",
"\\{?\\\\guilsinglleft\\}?" => "‹",
"\\{?\\\\guilsinglright\\}?" => "›",
"\\{?\\\\textfractionsolidus\\}?" => "⁄",
'\\$\\^\\{0\\}\\$' => "⁰",
'\\$\\^\\{4\\}\\$' => "⁴",
'\\$\\^\\{5\\}\\$' => "⁵",
'\\$\\^\\{6\\}\\$' => "⁶",
'\\$\\^\\{7\\}\\$' => "⁷",
'\\$\\^\\{8\\}\\$' => "⁸",
'\\$\\^\\{9\\}\\$' => "⁹",
'\\$\\^\\{+\\}\\$' => "⁺",
'\\$\\^\\{-\\}\\$' => "⁻",
'\\$\\^\\{=\\}\\$' => "⁼",
'\\$\\^\\{n\\}\\$' => "ⁿ",
'\\$_\\{0\\}\\$' => "₀",
'\\$_\\{1\\}\\$' => "₁",
'\\$_\\{2\\}\\$' => "₂",
'\\$_\\{3\\}\\$' => "₃",
'\\$_\\{4\\}\\$' => "₄",
'\\$_\\{5\\}\\$' => "₅",
'\\$_\\{6\\}\\$' => "₆",
'\\$_\\{7\\}\\$' => "₇",
'\\$_\\{8\\}\\$' => "₈",
'\\$_\\{9\\}\\$' => "₉",
'\\$_\\{+\\}\\$' => "₊",
'\\$_\\{-\\}\\$' => "₋",
'\\$_\\{=\\}\\$' => "₌",
"\\{?\\\\texteuro\\}?" => "€",
"\\{?\\\\textcelsius\\}?" => "℃",
"\\{?\\\\textnumero\\}?" => "№",
"\\{?\\\\textcircledP\\}?" => "℗",
"\\{?\\\\textservicemark\\}?" => "℠",
"\\{?\\\\texttrademark\\}?" => "™",
"\\{?\\\\textohm\\}?" => "Ω",
"\\{?\\\\textestimated\\}?" => "℮",
"\\{?\\\\textleftarrow\\}?" => "←",
"\\{?\\\\textuparrow\\}?" => "↑",
"\\{?\\\\textrightarrow\\}?" => "→",
"\\{?\\\\textdownarrow\\}?" => "↓",
'\\$\\\\infty\\$' => "∞",
"\\{?\\\\textlangle\\}?" => "〈",
"\\{?\\\\textrangle\\}?" => "〉",
"\\{?\\\\textvisiblespace\\}?" => "␣",
"\\{?\\\\textopenbullet\\}?" => "◦",
"\\{?\\\\Delta\\}?" => "Δ",
"\\{?\\\\iota\\}?" => "ι",
"\\{?\\\\omicron\\}?" => "ο",
"\\{?\\\\mu\\}?" => "μ",
"\\{?\\\\eta\\}?" => "η",
"\\{?\\\\delta\\}?" => "δ",
"\\{?\\\\varsigma\\}?" => "ς",
"\\{?\\\\Sigma\\}?" => "Σ",
"\\{?\\\\pi\\}?" => "π",
"\\{?\\\\nu\\}?" => "ν",
"\\{?\\\\epsilon\\}?" => "ε",
"\\{?\\\\lambda\\}?" => "λ",
"\\{?\\\\=\\{?o\\}?\\}?" => "ō",
);
}
}