FileInfo fi = new FileInfo(filename);
if (!fi.Exists || !is_format_compatible(filename))
{
text = null;
return;
}
try
//Создаем приложение
Word.Application wa = new Word.ApplicationClass();
object FileNmae = filename;
object def_value = Missing.Value;
//Открываем документ
Word.Document wd = wa.Documents.Open(ref FileNmae, ref def_value,
ref def_value, ref def_value, ref def_value, ref def_value,
ref def_value);
//Получаем текст
this.text = wd.Content.Text;
//Закрываем приложение
wa.Quit(ref def_value, ref def_value, ref def_value);
}//try
catch
//Произошла какая-то ошибка
}//public override void parse_file(..)
public override bool is_format_compatible(string filename)
filename = filename.ToLower();
//Проверим расширение
if (filename.IndexOf(".doc") < 0) return false;
return true;
public override string generate_sql_script()
return null;
Приложение В
Исходный текст CWebDocument.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
namespace dictionary
class CWebData
private HttpWebRequest request;
private HttpWebResponse response;
private Stream inet_stream;
public string get_web_page(string url)
//Отправляем запрос
request = (HttpWebRequest)WebRequest.Create(url);
//Получаем ответи от WEB-сервера
response = (HttpWebResponse)request.GetResponse();
//Получаем поток из ответа сервера
inet_stream = response.GetResponseStream();
//Тут будем хранить результат, полученный со страницы
string result = "";
//Получаем данные из потока
int c = 0;
while ((c = inet_stream.ReadByte()) != -1)
result += (char)c;
return result;
}//get_web_page
}//class
Приложение Г
Исходный код CFileReader.cs
static class CFileReader
/// <summary>
/// Чиатет весь файл в строку
/// </summary>
/// <param name="filename">Имя файла</param>
/// <returns>Строка, содержащая данные из файла</returns>
static public string ReadFile(string filename)
StreamReader Reader = new StreamReader(filename);
string tmp = "";
while ((tmp = Reader.ReadLine()) != null)
result += (tmp + '\n');
Reader.Close();
/// Чиатает в строку нужную линию из файла
/// <param name="lineNo">Номер строки, начиная с 0</param>
/// <returns>Прочитанную строку или null, если строка не найдена</returns>
static public string ReadFile(string filename, int lineNo)
string tmp;
//Добираемся до нужной строчки
for (int i = 0; i < lineNo; i++)
tmp = Reader.ReadLine();
if (tmp == null) //Нет больше строчек
}//for
result = Reader.ReadLine();
Приложение Д
Список ссылок “по буквам” Викисловаря
#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">#"#">http://ru.wiktionary.org/wiki/%D0%98%D0%BD%D0%B4%D0%B5%D0%BA%D1%81:%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9_%D1%8F%D0%B7%D1%8B%D0%BA/%D0%AF
Приложение E
Исходные коды приложений семантичсекого анализа
app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="app.Properties.Settings.adbConnectionString" connectionString="Data Source=E-ART-LAPTOP\SQLEXPRESS;Initial Catalog=adb;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
adbDataDesigner.Designer
#pragma warning disable 1591
namespace app {
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
[Serializable()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.ComponentModel.ToolboxItem(true)]
[System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
[System.Xml.Serialization.XmlRootAttribute("adbDataSet")]
[System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
public partial class adbDataSet : System.Data.DataSet {
private identitiesDataTable tableidentities;
private link_typesDataTable tablelink_types;
private linksDataTable tablelinks;
private text_identitiesDataTable tabletext_identities;
private textsDataTable tabletexts;
private System.Data.DataRelation relationlinks_link_types;
private System.Data.DataRelation relationlinks_link_types1;
private System.Data.SchemaSerializationMode _schemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public adbDataSet() {
this.BeginInit();
this.InitClass();
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
base.Relations.CollectionChanged += schemaChangedHandler;
this.EndInit();
protected adbDataSet(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
base(info, context, false) {
if ((this.IsBinarySerialized(info, context) == true)) {
this.InitVars(false);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler1;
this.Relations.CollectionChanged += schemaChangedHandler1;
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.IncludeSchema)) {
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
if ((ds.Tables["identities"] != null)) {
base.Tables.Add(new identitiesDataTable(ds.Tables["identities"]));
if ((ds.Tables["link_types"] != null)) {
base.Tables.Add(new link_typesDataTable(ds.Tables["link_types"]));
if ((ds.Tables["links"] != null)) {
base.Tables.Add(new linksDataTable(ds.Tables["links"]));
if ((ds.Tables["text_identities"] != null)) {
base.Tables.Add(new text_identitiesDataTable(ds.Tables["text_identities"]));
if ((ds.Tables["texts"] != null)) {
base.Tables.Add(new textsDataTable(ds.Tables["texts"]));
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
Страницы: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42