[generator] More comments for wikipedia tags processing

This commit is contained in:
Ilya Zverev 2015-09-25 19:47:06 +03:00
parent c0a444935d
commit 2e4bc5836e

View file

@ -219,7 +219,7 @@ protected:
if (i == string::npos || i < 2 || i + 2 > v.length())
return string();
// URL encode lang:title, so URL can be reconstructed faster
// URL encode lang:title (lang is at most 3 chars), so URL can be reconstructed faster
if (i <= 3 || v.substr(0, i) == "be-x-old")
return v.substr(0, i + 1) + WikiUrlEncode(v.substr(i + 1));
@ -227,7 +227,7 @@ protected:
if (v[i+1] == '/' && i + minUrlPartLength < v.length())
{
// Convert URL to "lang:title"
i += 3;
i += 3; // skip "://"
string::size_type const j = v.find('.', i + 1);
static string const wikiUrlPart = ".wikipedia.org/wiki/";
if (j != string::npos && v.substr(j, wikiUrlPart.length()) == wikiUrlPart)