public string GetSentence( int index )
{
if( corpus_rdr == null )
corpus_rdr = new System.IO.FileStream( corpus_path, System.IO.FileMode.Open );
corpus_rdr.Position = sent2pos[index];
// Загружаем текст предложения внутри узла <text>...</text>
ReadLine( corpus_rdr ); // пропускаем тег <sentence...>
string text_xml = ReadLine( corpus_rdr );
if( text_xml.StartsWith( "<text>" ) && text_xml.EndsWith( "</text>" ) )
{
return text_xml.Substring( 6, text_xml.Length - 6 - 7 );
}
else
{
return "";
}
}