Skip to content

Commit

Permalink
More punctuation (#2848)
Browse files Browse the repository at this point in the history
  • Loading branch information
GlazerMann committed May 7, 2020
1 parent e305c3a commit 476996d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion expandFns.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ function str_remove_irrelevant_bits($str) {
$str = preg_replace(REGEXP_PIPED_WIKILINK, "$2", $str); // Convert [[Y|X]] wikilinks into X
$str = trim($str);
$str = preg_replace("~^the\s+~i", "", $str); // Ignore leading "the" so "New York Times" == "The New York Times"
$str = str_replace(array('.', ',', ';', ':', ' ', ' '), ' ', $str); // punctuation and multiple spaces
// punctuation
$str = str_replace(array('.', ',', ';', ': '), array(' ', ' ', ' ', ' '), $str);
$str = str_replace(array(':', '-', '—', '–', '—', '–'), array('', '', '', '', '', ''), $str);
$str = str_replace(array(' ', ' '), array(' ', ' '), $str);
$str = trim($str);
$str = str_ireplace(array('Proceedings', 'Proceeding', 'Symposium', 'Huffington ', 'the Journal of ', 'nytimes.com' , '& ' , '(Clifton, N.J.)'),
array('Proc', 'Proc', 'Sym', 'Huff ', 'journal of ', 'New York Times', 'and ', ''), $str);
Expand Down

0 comments on commit 476996d

Please sign in to comment.