{"id":161073,"date":"2012-12-03T08:48:03","date_gmt":"2012-12-03T04:48:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=161073"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=161073","title":{"rendered":"<span class=\"post_title\">\u0427\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b\u0439 \u043d\u0430 python 3, \u0443\u043c\u0435\u044e\u0449\u0438\u0439 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e WordNet \u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e StarDict<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u0440\u0438\u0432\u0435\u0442 \u0432\u0441\u0435\u043c!<br \/>  \u042f \u0443\u0447\u0443 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439 \u0438 \u0432\u0441\u044f\u0447\u0435\u0441\u043a\u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u044e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041a\u0430\u043a\u0442\u043e \u043c\u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043b\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0438 \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430. \u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u0431\u044b\u043b\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0439, \u0438 \u044f \u043f\u0440\u0438\u043d\u044f\u043b\u0430\u0441\u044c \u0437\u0430 \u0434\u0435\u043b\u043e. \u0427\u0443\u0442\u044c \u043f\u043e\u0437\u0434\u043d\u0435\u0435 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 <b>python<\/b>, \u0432\u0441\u0435 \u044d\u0442\u043e \u0443\u043c\u0435\u044e\u0449\u0438\u0439, \u0438 \u0434\u0430\u0436\u0435 \u0443\u043c\u0435\u044e\u0449\u0438\u0439 \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0449\u0435 \u0438 \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0438\u0437 \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438. \u0422\u0430\u043a \u0432\u044b\u0448\u0435\u043b \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043d\u0430\u0431\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0438 \u0445\u043e\u0442\u0435\u043b\u0430 \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c. <br \/>  \u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0432\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432, \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0445, \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0435 \u0438 \u0432\u044b\u0434\u0430\u0447\u0438 \u043f\u0435\u0440\u0432\u044bx countWord \u0441\u043b\u043e\u0432 \u0438\u0437 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432. <br \/>  \u0412 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0441\u043b\u043e\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435:<br \/>  <b>[\u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439] [\u0441\u0430\u043c\u043e \u0441\u043b\u043e\u0432\u043e] [\u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u043b\u043e\u0432\u0430]<\/b><\/p>\n<p>  \u041e \u0447\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u043b\u044c\u0448\u0435:  <\/p>\n<ol>\n<li>\u041c\u044b \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <b>\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/b>);<\/li>\n<li>\u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445 \u0441 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b \u0432 \u0442\u043e\u0442 \u0432\u0438\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u0445 (\u0442\u0443\u0442 \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0438\u043c \u0444\u043e\u0440\u043c\u0430\u0442 <b>WordNet<\/b>);<\/li>\n<li>\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u0443 \u0432\u0441\u0435\u0445 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043b\u043e\u0432 (\u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e);<\/li>\n<li>\u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0443\u0433\u043b\u0443\u0431\u0438\u043c\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 <b>StarDict<\/b>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u0438 \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044e.<\/li>\n<li>\u041d\u0443 \u0438 \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 \u043c\u044b \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u044f \u0432\u044b\u0431\u0440\u0430\u043b\u0430 \u0444\u0430\u0439\u043b \u0444\u043e\u0440\u043c\u0430\u0442\u0430 <b>Excel<\/b>).<\/li>\n<\/ol>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430 <b>python 3.3<\/b> \u0438 \u043d\u0430\u0434\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0438 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043f\u043e\u0436\u0430\u043b\u0435\u043b\u0430, \u0447\u0442\u043e \u043d\u0435 \u043f\u0438\u0448\u0443 \u043d\u0430 python 2.7, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0447\u0430\u0441\u0442\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e \u043d\u0443\u0436\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. <\/p>\n<h4>\u0427\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440.<\/h4>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0444\u0430\u0439\u043b\u044b, \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u043c \u0438\u0445 \u043d\u0430 \u0441\u043b\u043e\u0432\u0430, \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c, \u0438 \u0432\u044b\u0434\u0430\u0434\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435.<\/p>\n<h5>\u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432<\/h5>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0435 \u0441\u043b\u043e\u0432\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u00abover\u00bb, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <b>&quot;([a-zA-Z]+)&quot;<\/b> \u2014 \u0437\u0434\u0435\u0441\u044c \u0438\u0449\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0430 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0431\u0443\u043a\u0432 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0433\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0430.<br \/>  \u0421\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u00abcommander-in-chief\u00bb, \u043d\u0430\u0439\u0442\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0438\u0434\u0443\u0449\u0438\u0435 \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0430 \u00abcommander-\u00bb, \u00abin-\u00bb, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0434\u0435\u0442 \u0441\u043b\u043e\u0432\u043e \u00abchief\u00bb. \u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434 <b>&quot;(([a-zA-Z]+-?)*[a-zA-Z]+)&quot;<\/b>.<br \/>  \u0415\u0441\u043b\u0438 \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0432\u0443\u0435\u0442 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0435 \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043e\u043d\u043e \u0442\u043e\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0422\u0430\u043a, \u0432 \u043d\u0430\u0448 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432\u043e \u00abcommander-in-chief\u00bb, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438 \u0432\u0441\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0427\u0442\u043e\u0431\u044b \u0438\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u0435\u043d\u0438\u044f <b>&#8216;?:<\/b>&#8216; \u0441\u0442\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u043a\u0440\u0443\u0433\u043b\u043e\u0439 \u0441\u043a\u043e\u0431\u043a\u0438. \u0422\u043e\u0433\u0434\u0430 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434<b> &quot;((?:[a-zA-Z]+-?)*[a-zA-Z]+)&quot;<\/b>. \u041d\u0430\u043c \u0435\u0449\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0432\u0430 \u0441 \u0430\u043f\u043e\u0441\u0442\u0440\u043e\u0444\u043e\u043c \u0432\u0438\u0434\u0430 \u00abdidn&#8217;t\u00bb. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438<b> &quot;-?&quot; \u043d\u0430 &quot;[-&#8216;]?&quot;<\/b>.<br \/>  \u0412\u0441\u0435, \u043d\u0430 \u044d\u0442\u043e\u043c \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c \u0438 \u0434\u0430\u043b\u044c\u0448\u0435, \u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u0442\u0430\u043a\u043e\u043c: <br \/>  <b>&quot;((?:[a-zA-Z]+[-&#8216;]?)*[a-zA-Z]+)&quot;<\/b><\/p>\n<h5>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432<\/h5>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441, \u0443\u043c\u0435\u044e\u0449\u0438\u0439 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0435 \u0441\u043b\u043e\u0432\u0430, \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0445 \u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*-   import re import os from collections import Counter   class FrequencyDict: \tdef __init__(): \t\t \t\t# \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432 \t\tself.wordPattern = re.compile(&quot;((?:[a-zA-Z]+[-']?)*[a-zA-Z]+)&quot;) \t\t \t\t# \u0427\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c(\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u043c \u043a\u043b\u0430\u0441\u0441 collections.Counter \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u0445) \t\t \t\tself.frequencyDict = Counter() \t\t \t# \u041c\u0435\u0442\u043e\u0434 \u043f\u0430\u0440\u0441\u0438\u0442 \u0444\u0430\u0439\u043b, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u0437 \u043d\u0435\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \tdef ParseBook(self, file): \t\tif file.endswith(&quot;.txt&quot;):  \t\t\tself.__ParseTxtFile(file, self.__FindWordsFromContent) \t\telse: \t\t\tprint('Warning: The file format is not supported: &quot;%s&quot;' %file) \t\t\t \t# \u041c\u0435\u0442\u043e\u0434 \u043f\u0430\u0440\u0441\u0438\u0442 \u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 txt \tdef __ParseTxtFile(self, txtFile, contentHandler): \t\ttry: \t\t\twith open(txtFile, 'rU') as file:\t\t \t\t\t\tfor line in file: # \u0427\u0438\u0442\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e \t\t\t\t\tcontentHandler(line) # \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \t\texcept Exception as e: \t\t\tprint('Error parsing &quot;%s&quot;' % txtFile, e)\t \t\t\t\t\t\t \t# \u041c\u0435\u0442\u043e\u0434 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441\u043b\u043e\u0432\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0432\u043e\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0438 \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \tdef __FindWordsFromContent(self, content): \t\tresult = self.wordPattern.findall(content) # \u0412 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0430\u0439\u0434\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432\t\t\t\t \t\tfor word in result: \t\t\tword = word.lower()\t# \u041f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u0441\u043b\u043e\u0432\u043e \u043a \u043d\u0438\u0436\u043d\u0435\u043c\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0443\t \t\t\t\tself.frequencyDict[word] += 1 # \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u043d\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e\t \t \t \t# \u041c\u0435\u0442\u043e\u0434 \u043e\u0442\u0434\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 countWord \u0441\u043b\u043e\u0432 \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f, \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \tdef FindMostCommonElements(self, countWord): \t\tdict = list(self.frequencyDict.items()) \t\tdict.sort(key=lambda t: t[0]) \t\tdict.sort(key=lambda t: t[1], reverse = True) \t\treturn dict[0 : int(countWord)] <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c, \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u043c \u043c\u043e\u0433\u043b\u0430 \u0431\u044b \u0431\u044b\u0442\u044c \u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430, \u043d\u043e \u043d\u0430\u0448\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f. \u0412\u0441\u0435 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u043b\u043e\u0432\u0430 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b, \u0430 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c\u0441\u044f \u0441\u043b\u043e\u0432\u0430 \u0441 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f\u043c\u0438 ed, ing \u0438 \u0442\u0434. \u041f\u043e \u0441\u0443\u0442\u0438, \u0434\u0430\u0436\u0435 \u0444\u043e\u0440\u043c\u044b \u0433\u043b\u0430\u0433\u043e\u043b\u0430 to be ( am, is, are) \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430.<br \/>  \u0417\u043d\u0430\u0447\u0438\u0442 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0441\u043b\u043e\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0432 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0441\u043b\u043e\u0432, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0435\u0433\u043e \u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435.<br \/>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e <b> \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432<\/b>.<\/p>\n<h4>\u041b\u0435\u043c\u043c\u0430\u0442\u0438\u0437\u0430\u0442\u043e\u0440 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432<\/h4>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u0432\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u2014 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/%D0%A1%D1%82%D0%B5%D0%BC%D0%BC%D0%B8%D0%BD%D0%B3\">\u0441\u0442\u0435\u043c\u043c\u0438\u043d\u0433 <\/a>\u0438 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/%D0%9B%D0%B5%D0%BC%D0%BC%D0%B0%D1%82%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F\">\u043b\u0435\u043c\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f<\/a>. \u0421\u0442\u0435\u043c\u043c\u0438\u043d\u0433 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u044d\u0432\u0440\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0443, \u0432 \u043d\u0435\u043c \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0431\u0430\u0437\u044b. \u041f\u0440\u0438 \u043b\u0435\u043c\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0430\u0437\u044b \u0441\u043b\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c. \u041c\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0435\u043c\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u0438 \u0441\u0442\u0435\u043c\u043c\u0438\u043d\u0433\u0435.<\/p>\n<p>  \u041f\u0440\u043e \u043b\u0435\u043c\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/habrahabr.ru\/post\/123334\/\">\u0432\u043e\u0442<\/a> \u0438 <a href=\"http:\/\/habrahabr.ru\/post\/49421\/\">\u0432\u043e\u0442<\/a>. \u041e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0431\u0430\u0437\u044b <a href=\"http:\/\/aot.ru\">aot<\/a>. \u041c\u043d\u0435 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c\u0441\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u043b\u044f \u043b\u0435\u043c\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u042f \u0445\u043e\u0442\u0435\u043b\u0430 \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e <a href=\"http:\/\/ru.wikipedia.org\/wiki\/WordNet\">WordNet<\/a>, \u043d\u0430 \u043d\u0435\u043c \u043b\u0435\u043c\u043c\u0430\u0442\u0438\u0437\u0430\u0442\u043e\u0440 \u043c\u044b \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c. \u041d\u0430\u0447\u043d\u0443 \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0430 <a href=\"http:\/\/wordnet.princeton.edu\/wordnet\/download\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 WordNet<\/a> \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u0441\u0430\u043c\u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. WordNet \u0443\u043c\u0435\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u043c\u0430\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u2014 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043b\u043e\u0432. <br \/>   \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 WordNet (\u043d\u0430 \u0441\u0438) \u043e\u043f\u0438\u0441\u0430\u043d \u0441\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0441\u0430\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u044f \u0432\u0437\u044f\u043b\u0430 \u043e\u0442\u0442\u0443\u0434\u0430, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0432 \u043d\u0430 python. \u0410\u0445 \u0434\u0430, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f \u0434\u043b\u044f WordNet \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f python \u2014 <a href=\"http:\/\/nltk.org\/\">nltk<\/a>, \u043d\u043e \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 python 2.7, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0433\u043b\u043e \u044f \u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0430, \u043f\u0440\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u043e\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 WordNet.<br \/>  \u041e\u0431\u0449\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043b\u044f \u043b\u0435\u043c\u043c\u0430\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/355\/a91\/971\/355a919713a1e1d9bebbe54c943665d0.png\"\/><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b, \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e 4 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0447\u0438 (\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435, \u0433\u043b\u0430\u0433\u043e\u043b\u044b, \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438 \u043d\u0430\u0440\u0435\u0447\u0438\u044f).<br \/>  \u0415\u0441\u043b\u0438 \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u043e \u043e\u043d \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:<br \/>  1. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0447\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0438\u0437 WordNet \u043f\u043e 2 \u0444\u0430\u0439\u043b\u0430 \u2014 \u0438\u043d\u0434\u0435\u043a\u0441\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c (\u0438\u043c\u0435\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 index \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0447\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 index.adv \u0434\u043b\u044f \u043d\u0430\u0440\u0435\u0447\u0438\u0439) \u0438 \u0444\u0430\u0439\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 ( \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 exc \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0447\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 adv.exc \u0434\u043b\u044f \u043d\u0430\u0440\u0435\u0447\u0438\u0439).<br \/>  2. \u041f\u0440\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043f\u0435\u0440\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u0435\u0441\u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u0442\u0430\u043c \u0435\u0441\u0442\u044c, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430. \u0415\u0441\u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c, \u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u0438\u0434\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0442\u0441\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435, \u043f\u0440\u0438\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u043e\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435, \u0437\u0430\u0442\u0435\u043c \u0441\u043b\u043e\u0432\u043e \u0438\u0449\u0435\u0442\u0441\u044f \u0432 \u0438\u043d\u0434\u0435\u043a\u0441\u043d\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u0438 \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u0442\u0430\u043c \u0435\u0441\u0442\u044c, \u0442\u043e \u0441\u043b\u043e\u0432\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c. \u0418\u043d\u0430\u0447\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0438 \u0442\u0434, \u043f\u043e\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0430\u0442\u0441\u044f \u0438\u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0440\u0430\u043d\u044c\u0448\u0435.<br \/>  \u041a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u043b\u0435\u043c\u043c\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441  \u0434\u043b\u044f \u0447\u0430\u0441\u0442\u0435\u0439 \u0440\u0435\u0447\u0438 BaseWordNetItem.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*-   import os  class BaseWordNetItem: \t# \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \tdef __init__(self, pathWordNetDict, excFile, indexFile): \t \t\tself.rule=() # \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0437\u0430\u043c\u0435\u043d\u044b \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0439 \u043f\u0440\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c. \t\t \t\tself.wordNetExcDict={}  # \u0421\u043b\u043e\u0432\u0430\u0440\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \t\tself.wordNetIndexDict=[] # \u0418\u043d\u0434\u0435\u043a\u0441\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432\t \t\t \t\tself.excFile = os.path.join(pathWordNetDict, excFile) # \u041f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439\t \t\tself.indexFile = os.path.join(pathWordNetDict, indexFile) # \u041f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0443\u0442\u044c \u0434\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f \t\t \t\tself.__ParseFile(self.excFile, self.__AppendExcDict) # \u0417\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \t\tself.__ParseFile(self.indexFile, self.__AppendIndexDict) # \u0417\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432   \t\tself.cacheWords={} # \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u041a\u044d\u0448 \u0434\u043b\u044f \u0443\u0436\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043b\u043e\u0432, \u043a\u043b\u044e\u0447 - \u043d\u0435\u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 - \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e\t \t\t \t\t\t \t\t\t \t# \u041c\u0435\u0442\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.  \t# \u0424\u0430\u0439\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435: [\u0441\u043b\u043e\u0432\u043e-\u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435][\u043f\u0440\u043e\u0431\u0435\u043b][\u043b\u0435\u043c\u043c\u0430]\t \tdef __AppendExcDict(self, line):\t\t\t \t\t# \u041f\u0440\u0438 \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430, \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c \u043d\u0430 2 \u0441\u043b\u043e\u0432\u0430 \u0438 \u0437\u0430\u043d\u043e\u0441\u0438\u043c \u0441\u043b\u043e\u0432\u0430 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c(\u043f\u0435\u0440\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e - \u043a\u043b\u044e\u0447, \u0432\u0442\u043e\u0440\u043e\u0435 - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435). \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0443\u0431\u0440\u0430\u0442\u044c \u0441 \u043a\u043e\u043d\u0446\u043e\u0432 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \t\tgroup = [item.strip() for item in line.replace(&quot;\\n&quot;,&quot;&quot;).split(&quot; &quot;)] \t\tself.wordNetExcDict[group[0]] = group[1]  \t\t\t \t\t\t \t# \u041c\u0435\u0442\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0438\u043d\u0434\u0435\u043a\u0441\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \tdef __AppendIndexDict(self, line):\t\t\t \t\t# \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0431\u0435\u0440\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \t\tgroup = [item.strip() for item in line.split(&quot; &quot;)] \t\tself.wordNetIndexDict.append(group[0])  \t\t  \t# \u041c\u0435\u0442\u043e\u0434 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435, \u0447\u0438\u0442\u0430\u0435\u0442 \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u0443\u044e \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 \tdef __ParseFile(self, file, contentHandler):\t \t\ttry: \t\t\twith open(file, 'r') as openFile:  \t\t\t\tfor line in openFile: \t\t\t\t\tcontentHandler(line)\t# \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \t\texcept Exception as e: \t\t\traise Exception('File does not load: &quot;%s&quot;' %file)\t \t\t\t \t\t\t \t# \u041c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u043d\u0435\u0442, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.  \t# \u041f\u043e\u0434 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u043c \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445  \tdef _GetDictValue(self, dict, key): \t\ttry: \t\t\treturn dict[key]\t\t \t\texcept KeyError: \t\t\treturn None \t\t \t\t \t\t \t# \u041c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043b\u043e\u0432\u043e \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043b\u0438\u0431\u043e True, \u043b\u0438\u0431\u043e False. \t# \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u0441\u043b\u043e\u0432\u043e, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432(\u0442\u0430\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043b\u043e\u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0447\u0438).\t \tdef _IsDefined(self, word): \t\tif word in self.wordNetIndexDict: \t\t\treturn True \t\treturn False\t\t \t \t \t \t# \u041c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043b\u0435\u043c\u043c\u0443(\u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0441\u043b\u043e\u0432\u0430)\t\t\t \tdef GetLemma(self, word): \t \t\tword = word.strip().lower()  \t \t\t# \u041f\u0443\u0441\u0442\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \t\tif word == None: \t\t\treturn None\t  \t\t# \u041f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u043a\u044d\u0448\u0443, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043b\u043e\u0432\u043e \u0443\u0436\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u044c\u0448\u0435 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0441\u044f \u0432 \u043a\u044d\u0448\u0435 \t\tlemma = self._GetDictValue(self.cacheWords, word) \t\tif lemma != None: \t\t\treturn lemma \t\t\t \t\t# \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0435\u0441\u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u0443\u0436\u0435 \u0432 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435, \u0432\u0435\u0440\u043d\u0435\u043c \u0435\u0433\u043e \u0436\u0435 \t\tif self._IsDefined(word): \t\t\treturn word \t\t\t \t\t\t \t\t# \u041f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c, \u0435\u0441\u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u0438\u0437 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u0432\u0435\u0440\u043d\u0435\u043c \u0435\u0433\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \t\tlemma = self._GetDictValue(self.wordNetExcDict, word) \t\tif lemma != None: \t\t\treturn lemma \t \t\t\t \t\t# \u041d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u043b\u043e\u0432\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0438 \u043e\u043d\u043e \u043d\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e, \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c.  \t\tlemma = self._RuleNormalization(word) \t\tif lemma != None: \t\t\tself.cacheWords[word] = lemma # \u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0432 \u043a\u044d\u0448 \t\t\treturn lemma\t\t  \t\treturn None\t \t\t \t\t \t\t \t# \u041d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c (\u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c, \u0441\u043b\u043e\u0432\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435) \tdef _RuleNormalization(self, word): \t\t# \u0411\u0435\u0436\u0438\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u043b\u0438 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430 \u0441 \u043a\u0430\u043a\u0438\u043c \u043b\u0438\u0431\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e\u043c, \u0435\u0441\u043b\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u0442\u043e \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043e\u043a\u043e\u043d\u0447\u043d\u0438\u0435.\t \t\tfor replGroup in self.rule: \t\t\tendWord = replGroup[0]\t\t\t \t\t\tif word.endswith(endWord): \t \t\t\t\tlemma = word # \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \t\t\t\tlemma = lemma.rstrip(endWord) # \u041e\u0442\u0440\u0435\u0437\u0430\u0435\u043c \u0441\u0442\u0430\u0440\u043e\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 \t\t\t\tlemma += replGroup[1] # \u041f\u0440\u0438\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 \t\t\t\tif self._IsDefined(lemma): # \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u043d\u043e\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435, \u0438 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u0430\u043a, \u0442\u043e \u0432\u0435\u0440\u043d\u0435\u043c \u0435\u0433\u043e \t\t\t\t\treturn lemma\t \t\treturn None <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u043b\u0430\u0433\u043e\u043b\u043e\u0432 WordNetVerb.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*-    from WordNet.BaseWordNetItem import BaseWordNetItem  # \u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u043b\u0430\u0433\u043e\u043b\u043e\u0432 # \u041a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 BaseWordNetItem  class WordNetVerb(BaseWordNetItem): \tdef __init__(self, pathToWordNetDict): \t \t\t# \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f (BaseWordNetItem) \t\tBaseWordNetItem.__init__(self, pathToWordNetDict, 'verb.exc', 'index.verb')   \t\t# \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0437\u0430\u043c\u0435\u043d\u044b \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0439 \u043f\u0440\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 &quot;s&quot; \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 &quot;&quot; , &quot;ies&quot; \u043d\u0430 \u0438 &quot;y&quot; \u0442\u0434. \t\tself.rule = (\t \t\t\t\t\t\t[&quot;s&quot;   , &quot;&quot;  ], \t\t\t\t\t\t[&quot;ies&quot; , &quot;y&quot; ], \t\t\t\t\t\t[&quot;es&quot;  , &quot;e&quot; ], \t\t\t \t\t\t\t\t\t[&quot;es&quot;  , &quot;&quot;  ],\t \t\t\t\t\t\t[&quot;ed&quot;  , &quot;e&quot; ], \t\t\t \t\t\t\t\t\t[&quot;ed&quot;  , &quot;&quot;  ],\t \t\t\t\t\t\t[&quot;ing&quot; , &quot;e&quot; ], \t\t\t \t\t\t\t\t\t[&quot;ing&quot; , &quot;&quot;  ]\t \t\t\t\t\t)  \t\t# \u041c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b \u0441\u043b\u043e\u0432\u0430 GetLemma(word) \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 BaseWordNetItem <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 WordNetNoun.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*-    from WordNet.BaseWordNetItem import BaseWordNetItem  # \u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 # \u041a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 BaseWordNetItem  class WordNetNoun(BaseWordNetItem): \tdef __init__(self, pathToWordNetDict): \t \t\t# \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f (BaseWordNetItem) \t\tBaseWordNetItem.__init__(self, pathToWordNetDict, 'noun.exc', 'index.noun') \t\t \t\t# \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0437\u0430\u043c\u0435\u043d\u044b \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0439 \u043f\u0440\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 &quot;s&quot; \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 &quot;&quot;, &quot;ses&quot; \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 &quot;s&quot; \u0438 \u0442\u0434. \t\tself.rule = (\t \t\t\t\t\t\t[&quot;s&quot;    , &quot;&quot;    ], \t\t\t\t\t\t[&quot;\u2019s&quot;   , &quot;&quot;    ], \t\t\t\t\t\t[&quot;\u2019&quot;    , &quot;&quot;    ],\t\t\t\t\t\t\t \t\t\t\t\t\t[&quot;ses&quot;  , &quot;s&quot;   ], \t\t\t\t\t\t[&quot;xes&quot;  , &quot;x&quot;   ], \t\t\t \t\t\t\t\t\t[&quot;zes&quot;  , &quot;z&quot;   ],\t \t\t\t\t\t\t[&quot;ches&quot; , &quot;ch&quot;  ], \t\t\t \t\t\t\t\t\t[&quot;shes&quot; , &quot;sh&quot;  ], \t\t\t\t\t\t[&quot;men&quot;  , &quot;man&quot; ], \t\t\t \t\t\t\t\t\t[&quot;ies&quot;  , &quot;y&quot;   ]\t\t\t\t\t \t\t\t\t\t)\t  \t\t\t\t\t \t\t\t\t\t \t# \u041c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043b\u0435\u043c\u043c\u0443 \u0441\u0443\u0448\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e(\u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0441\u043b\u043e\u0432\u0430) \t# \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0435\u0441\u0442\u044c \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 BaseWordNetItem, \u043d\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0440\u0435\u0447\u0438,  \t# \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434 \u0432 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \tdef GetLemma(self, word):\t \t\t \t\tword = word.strip().lower()  \t\t \t\t# \u0415\u0441\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0435, \u0442\u043e \u043a \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443 \u043c\u044b \u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c\t \t\tif len(word) &lt;= 2: \t\t\treturn None\t  \t\t# \u0415\u0441\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 &quot;ss&quot;, \u0442\u043e \u043a \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443 \u043c\u044b \u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c\t \t\tif word.endswith(&quot;ss&quot;): \t\t\treturn None\t \t\t\t \t\t# \u041f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u043a\u044d\u0448\u0443, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043b\u043e\u0432\u043e \u0443\u0436\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u044c\u0448\u0435 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0441\u044f \u0432 \u043a\u044d\u0448\u0435 \t\tlemma = self._GetDictValue(self.cacheWords, word) \t\tif lemma != None: \t\t\treturn lemma \t\t\t \t\t# \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0435\u0441\u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u0443\u0436\u0435 \u0432 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435, \u0432\u0435\u0440\u043d\u0435\u043c \u0435\u0433\u043e \u0436\u0435 \t\tif self._IsDefined(word): \t\t\treturn word \t\t \t\t# \u041f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c, \u0435\u0441\u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u0438\u0437 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u0432\u0435\u0440\u043d\u0435\u043c \u0435\u0433\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \t\tlemma = self._GetDictValue(self.wordNetExcDict, word) \t\tif (lemma != None): \t\t\treturn lemma  \t\t\t \t\t# \u0415\u0441\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 &quot;ful&quot;, \u0437\u043d\u0430\u0447\u0438\u0442 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c &quot;ful&quot;, \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0435\u0441\u044f \u0441\u043b\u043e\u0432\u043e, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u0443\u0444\u0444\u0438\u043a\u0441 \u043f\u0440\u0438\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u043c \u043d\u0430\u0437\u0430\u0434. \t\t# \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0438\u0437 \u0441\u043b\u043e\u0432\u0430 &quot;spoonsful&quot; \u043f\u043e\u0441\u043b\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f &quot;spoonful&quot; \t\tsuff = &quot;&quot; \t\tif word.endswith(&quot;ful&quot;):  \t\t\t\tword = word[:-3] # \u041e\u0442\u0440\u0435\u0437\u0430\u0435\u043c \u0441\u0443\u0444\u0444\u0438\u043a\u0441 &quot;ful&quot; \t\t\t\tsuff = &quot;ful&quot; # \u041e\u0442\u0440\u0435\u0437\u0430\u0435\u043c \u0441\u0443\u0444\u0444\u0438\u043a\u0441 &quot;ful&quot;, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438\u043a\u043b\u0435\u0438\u0442\u044c \u043d\u0430\u0437\u0430\u0434 \t\t \t\t \t\t# \u041d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u043b\u043e\u0432\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0438 \u043e\u043d\u043e \u043d\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e, \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c.  \t\tlemma = self._RuleNormalization(word) \t\tif (lemma != None): \t\t\tlemma += suff # \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0443\u0444\u0444\u0438\u043a\u0441 &quot;ful&quot;, \u0435\u0441\u043b\u0438 \u043e\u043d \u0431\u044b\u043b \t\t\tself.cacheWords[word] = lemma # \u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0432 \u043a\u044d\u0448 \t\t\treturn lemma\t\t  \t\treturn None\t \t <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0440\u0435\u0447\u0438\u0439  WordNetAdverb.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*-    from WordNet.BaseWordNetItem import BaseWordNetItem  # \u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0440\u0435\u0447\u0438\u0439 # \u041a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 BaseWordNetItem  class WordNetAdverb(BaseWordNetItem): \tdef __init__(self, pathToWordNetDict): \t \t\t# \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f (BaseWordNetItem) \t\tBaseWordNetItem.__init__(self, pathToWordNetDict, 'adv.exc', 'index.adv') \t\t \t\t# \u0423 \u043d\u0430\u0440\u0435\u0447\u0438\u0439 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0438\u0441\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439(adv.exc) \u0438 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043b\u043e\u0432(index.adv).\t \t\t# \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0437\u0430\u043c\u0435\u043d\u044b \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0439 \u043f\u0440\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0443 \u043d\u0430\u0440\u0435\u0447\u0438\u0439 \u043d\u0435\u0442.  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 WordNetAdjective.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*-   from WordNet.BaseWordNetItem import BaseWordNetItem  # \u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 # \u041a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 BaseWordNetItem  class WordNetAdjective(BaseWordNetItem): \tdef __init__(self, pathToWordNetDict): \t \t\t# \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f (BaseWordNetItem) \t\tBaseWordNetItem.__init__(self, pathToWordNetDict, 'adj.exc', 'index.adj')   \t\t# \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0437\u0430\u043c\u0435\u043d\u044b \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0439 \u043f\u0440\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 &quot;er&quot; \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 &quot;&quot; \u0438\u043b\u0438  &quot;e&quot; \u0438 \u0442\u0434. \t\tself.rule = (\t \t\t\t\t\t\t[&quot;er&quot;  , &quot;&quot; ], \t\t\t\t\t\t[&quot;er&quot;  , &quot;e&quot;], \t\t\t\t\t\t[&quot;est&quot; , &quot;&quot; ], \t\t\t \t\t\t\t\t\t[&quot;est&quot; , &quot;e&quot;]\t \t\t\t\t\t)  \t\t\t\t\t\t \t\t# \u041c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b \u0441\u043b\u043e\u0432\u0430 GetLemma(word) \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 BaseWordNetItem <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043b\u0435\u043c\u043c\u0430\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430 Lemmatizer.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*-    from WordNet.WordNetAdjective import WordNetAdjective from WordNet.WordNetAdverb import WordNetAdverb from WordNet.WordNetNoun import WordNetNoun from WordNet.WordNetVerb import WordNetVerb  class Lemmatizer: \tdef __init__(self, pathToWordNetDict): \t \t\t# \u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0445 \u0441\u043b\u043e\u0432\t \t\tself.splitter = &quot;-&quot; \t\t\t\t\t\t \t\t \t\t# \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441 \u0447\u0430\u0441\u0442\u044f\u043c \u0440\u0435\u0447\u0438 \t\tadj = WordNetAdjective(pathToWordNetDict)\t# \u041f\u0440\u0438\u043b\u0430\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \t\tnoun = WordNetNoun(pathToWordNetDict)\t\t# \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \t\tadverb = WordNetAdverb(pathToWordNetDict)\t# \u041d\u0430\u0440\u0435\u0447\u0438\u044f \t\tverb = WordNetVerb(pathToWordNetDict)\t\t# \u0413\u043b\u0430\u0433\u043e\u043b\u044b \t\t \t\tself.wordNet = [verb, noun, adj, adverb] \t\t  \t# \u041c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043b\u0435\u043c\u043c\u0443 \u0441\u043b\u043e\u0432\u0430 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0433\u043e)\t\t \tdef GetLemma(self, word): \t\t# \u0415\u0441\u043b\u0438 \u0432 \u0441\u043b\u043e\u0432\u0435 \u0435\u0441\u0442\u044c \u0442\u0438\u0440\u0435, \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0441\u043b\u043e\u0432\u043e \u043d\u0430 \u0447\u0430\u0441\u0442\u0438, \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0447\u0430\u0441\u0442\u044c(\u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043b\u043e\u0432\u043e) \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043c \t\twordArr = word.split(self.splitter) \t\tresultWord = [] \t\tfor word in wordArr: \t\t\tlemma = self.__GetLemmaWord(word) \t\t\tif (lemma != None): \t\t\t\tresultWord.append(lemma) \t\tif (resultWord != None): \t\t\treturn self.splitter.join(resultWord) \t\treturn None\t\t \t\t \t\t \t\t \t# \u041c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043b\u0435\u043c\u043c\u0443(\u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0441\u043b\u043e\u0432\u0430)\t\t\t \tdef __GetLemmaWord(self, word): \t\tfor item in self.wordNet: \t\t\tlemma = item.GetLemma(word) \t\t\tif (lemma != None): \t\t\t\treturn lemma \t\treturn None\t\t \t\t\t\t <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0443 \u0432\u043e\u0442, \u0441 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0443\u043c\u0435\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u2014 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u0432 \u0438 \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u0438 \u0434\u043b\u044f \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432. <\/p>\n<h4>\u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445 \u0441\u043b\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 StarDict<\/h4>\n<p>  \u041f\u0440\u043e <a href=\"http:\/\/ru.wikipedia.org\/wiki\/StarDict\">StarDict <\/a> \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043e\u043b\u0433\u043e, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u044d\u0442\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0442\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u043d\u044b\u0445 \u0431\u0430\u0437, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 \u0432\u0441\u0435\u0445 \u044f\u0437\u044b\u043a\u0430\u0445. \u041d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0435\u0449\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430 \u0442\u0435\u043c\u0443 StarDict \u0438 \u043f\u043e\u0440\u0430 \u0432\u043e\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e \u043f\u0440\u043e\u0431\u0435\u043b. \u0424\u0430\u0439\u043b, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 StarDict, \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0440\u044f\u0434\u043e\u043c \u0441 \u0441\u0430\u043c\u0438\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438.<br \/>  \u0415\u0441\u043b\u0438 \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0437\u043d\u0430\u043d\u0438\u0439 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0444\u043e\u0440\u043c\u0430\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<br \/>   \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 3 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<p>  1. \u0424\u0430\u0439\u043b \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c <b>ifo <\/b> \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f;<br \/>  2. \u0424\u0430\u0439\u043b \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c <b>idx <\/b>. \u041a\u0430\u0436\u0434\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u043d\u0443\u0442\u0440\u0438 idx \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 3-\u0445 \u043f\u043e\u043b\u0435\u0439, \u0438\u0434\u0443\u0449\u0438\u0445 \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c:  <\/p>\n<ul>\n<li><b>word_str<\/b> \u2014 \u0421\u0442\u0440\u043e\u043a\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 utf-8, \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0449\u0430\u044f\u0441\u044f &#8216;\\0&#8217;;<\/li>\n<li><b>word_data_offset<\/b> -\u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 .dict (\u0440\u0430\u0437\u043c\u0435\u0440 \u0447\u0438\u0441\u043b\u0430 32 \u0438\u043b\u0438 64 \u0431\u0438\u0442\u0430);<\/li>\n<li><b>word_data_size<\/b> \u2014 \u0420\u0430\u0437\u043c\u0435\u0440 \u0432\u0441\u0435\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 .dict.<\/li>\n<\/ul>\n<p>  3. \u0424\u0430\u0439\u043b \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c <b>dict<\/b> \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0430\u043c\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b, \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0437\u043d\u0430\u044f \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 (\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 idx ).<\/p>\n<p>  \u041d\u0435 \u0434\u043e\u043b\u0433\u043e \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u044f\u044f \u043d\u0430\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0432 \u0438\u0442\u043e\u0433\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f, \u044f \u0441\u043e\u0437\u0434\u0430\u043b\u0430 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432, \u0438 \u043e\u0434\u0438\u043d \u043e\u0431\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 StarDict, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0438\u0439 \u0438\u0445. <br \/>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0430\u044f\u0441\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u0432:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/226\/5cd\/b47\/2265cdb471d0b995a847da0c4fadb746.png\"\/><\/p>\n<p>  \u041a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0434\u0447\u0438\u043a\u0430 StarDict:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044f BaseStarDictItem.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*-    import os  class BaseStarDictItem: \tdef __init__(self, pathToDict, exp): \t \t\t# \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \t\tself.encoding = &quot;utf-8&quot; \t\t \t\t# \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \t\tself.dictionaryFile = self.__PathToFileInDirByExp(pathToDict, exp) \t\t \t\t# \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \t\tself.realFileSize = os.path.getsize(self.dictionaryFile)\t  \t \t \t# \u041c\u0435\u0442\u043e\u0434 \u0438\u0449\u0435\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 path \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u043f\u0430\u043f\u0432\u0448\u0438\u0439\u0441\u044f \u0444\u0430\u0439\u043b \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c exp  \tdef __PathToFileInDirByExp(self, path, exp): \t\tif not os.path.exists(path): \t\t\traise Exception('Path &quot;%s&quot; does not exists' % path)\t \t\t \t\tend = '.%s'%(exp) \t\tlist = [f for f in os.listdir(path) if f.endswith(end)] \t\tif list:  \t\t\treturn os.path.join(path, list[0]) # \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0439\u0441\u044f \t\telse: \t\t\traise Exception('File does not exist: &quot;*.%s&quot;' % exp)\t \t\t\t <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043b\u0430\u0441\u0441 Ifo.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*-    from StarDict.BaseStarDictItem import BaseStarDictItem from Frequency.IniParser import IniParser  class Ifo(BaseStarDictItem): \tdef __init__(self, pathToDict): \t\t \t\t# \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f (BaseStarDictItem) \t\tBaseStarDictItem.__init__(self, pathToDict, 'ifo')\t  \t\t# \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u0440\u0441\u0435\u0440 \t\tself.iniParser = IniParser(self.dictionaryFile) \t\t \t\t# \u0421\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0437 ifo \u0444\u0430\u0439\u043b\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \t\t# \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u043e \u0438\u0437 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \t\tself.bookName = self.__getParameterValue(&quot;bookname&quot;, None) # \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f [\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435] \t\tself.wordCount = self.__getParameterValue(&quot;wordcount&quot;, None)  # \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0432 \u0432 &quot;.idx&quot; \u0444\u0430\u0439\u043b\u0435 [\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435] \t\tself.synWordCount = self.__getParameterValue(&quot;synwordcount&quot;, &quot;&quot;)  # \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0432 \u0432 &quot;.syn&quot; \u0444\u0430\u0439\u043b\u0435 \u0441\u0438\u043d\u043e\u043d\u0438\u043c\u043e\u0432 [\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b &quot;.syn&quot;] \t\tself.idxFileSize = self.__getParameterValue(&quot;idxfilesize&quot;, None) # \u0420\u0430\u0437\u043c\u0435\u0440 (\u0432 \u0431\u0430\u0439\u0442\u0430\u0445) &quot;.idx&quot; \u0444\u0430\u0439\u043b\u0430. \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u0441\u0436\u0430\u0442 \u0430\u0440\u0445\u0438\u0432\u0430\u0442\u043e\u0440\u043e\u043c, \u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0435\u0441\u0436\u0430\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 [\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435] \t\tself.idxOffsetBits = self.__getParameterValue(&quot;idxoffsetbits&quot;, 32)  # \u0420\u0430\u0437\u043c\u0435\u0440 \u0447\u0438\u0441\u043b\u0430 \u0432 \u0431\u0438\u0442\u0430\u0445(32 \u0438\u043b\u0438 64), \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 .dict. \u041f\u043e\u043b\u0435 \u043f\u043e\u044f\u0438\u043b\u043e\u0441\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 3.0.0, \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b\u043e 32 [\u041d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435] \t\tself.author = self.__getParameterValue(&quot;author&quot;, &quot;&quot;) # \u0410\u0432\u0442\u043e\u0440 \u0441\u043b\u043e\u0432\u0430\u0440\u044f [\u041d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435] \t\tself.email = self.__getParameterValue(&quot;email&quot;, &quot;&quot;) # \u041f\u043e\u0447\u0442\u0430 [\u041d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435] \t\tself.description = self.__getParameterValue(&quot;description&quot;, &quot;&quot;) # \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f [\u041d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435] \t\tself.date = self.__getParameterValue(&quot;date&quot;, &quot;&quot;) # \u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044f [\u041d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435] \t\tself.sameTypeSequence = self.__getParameterValue(&quot;sametypesequence&quot;, None) # \u041c\u0430\u0440\u043a\u0435\u0440, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438[\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435] \t\tself.dictType = self.__getParameterValue(&quot;dicttype&quot;, &quot;&quot;) # \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u043d\u044b\u043c\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 WordNet[\u041d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435]\t\t\t \t  \tdef __getParameterValue(self, key, defaultValue): \t\ttry: \t\t\treturn self.iniParser.GetValue(key)  \t\texcept: \t\t\tif defaultValue != None: \t\t\t\treturn defaultValue \t\t\traise Exception('\\n&quot;%s&quot; has invalid format (missing parameter: &quot;%s&quot;)' % (self.dictionaryFile, key))\t <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043b\u0430\u0441\u0441 Idx.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*-    from struct import unpack from StarDict.BaseStarDictItem import BaseStarDictItem   class Idx(BaseStarDictItem):  \t# \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \tdef __init__(self, pathToDict, wordCount, idxFileSize, idxOffsetBits):  \t\t# \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f (BaseStarDictItem) \t\tBaseStarDictItem.__init__(self, pathToDict, 'idx') \t\t \t\tself.idxDict ={} # \u0421\u043b\u043e\u0432\u0430\u0440\u044c, self.idxDict = {'\u0438\u043d\u043e\u0441\u0442\u0440.\u0441\u043b\u043e\u0432\u043e': [\u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435_\u0434\u043e_\u0437\u0430\u043f\u0438\u0441\u0438_\u0432_\u0444\u0430\u0439\u043b\u0435_dict, \u0420\u0430\u0437\u043c\u0435\u0440_\u0432\u0441\u0435\u0439_\u0437\u0430\u043f\u0438\u0441\u0438_\u0432_\u0444\u0430\u0439\u043b\u0435_dict], ...}\t \t\tself.idxFileSize = int(idxFileSize) # \u0420\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 .idx, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432 .ifo \u0444\u0430\u0439\u043b\u0435 \t\tself.idxOffsetBytes = int(idxOffsetBits\/8) # \u0420\u0430\u0437\u043c\u0435\u0440 \u0447\u0438\u0441\u043b\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 .dict. \u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0432 \u0431\u0430\u0439\u0442\u044b \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043a \u0447\u0438\u0441\u043b\u0443 \t\tself.wordCount = int(wordCount) # \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0432 \u0432 &quot;.idx&quot; \u0444\u0430\u0439\u043b\u0435 \t\t \t\t# \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u043b\u043e\u0432\u0430\u0440\u044f (\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432 .ifo \u0444\u0430\u0439\u043b\u0435 \u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0435 .idx \u0444\u0430\u0439\u043b\u0430 [idxfilesize] \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c) \t\tself.__CheckRealFileSize() \t\t \t\t# \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c self.idxDict \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 .idx \t\tself.__FillIdxDict() \t \t\t# \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u043b\u043e\u0432\u0430\u0440\u044f (\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432 .ifo \u0444\u0430\u0439\u043b\u0435 \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043b\u043e\u0432 [wordcount] \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 .idx \u0444\u0430\u0439\u043b\u0435) \t\tself.__CheckRealWordCount() \t \t \t# \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0432\u0435\u0440\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432 .ifo \u0444\u0430\u0439\u043b\u0435, \u0441 \u0435\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\t \tdef __CheckRealFileSize(self): \t\tif self.realFileSize != self.idxFileSize: \t\t\traise Exception('size of the &quot;%s&quot; is incorrect' %self.dictionaryFile)  \t\t\t \t# \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0432\u0435\u0440\u044f\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043b\u043e\u0432, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 .ifo \u0444\u0430\u0439\u043b\u0435, \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0444\u0430\u0439\u043b\u0435 .idx \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\t\t\t \tdef __CheckRealWordCount(self): \t\trealWordCount = len(self.idxDict) \t\tif realWordCount != self.wordCount: \t\t\traise Exception('word count of the &quot;%s&quot; is incorrect' %self.dictionaryFile) \t  \t# \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442\u043e\u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b, \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0430\u0437\u0443\u0435\u0442 \u0431\u0430\u0439\u0442\u043a\u043e\u0434 \u0432 \u0447\u0438\u0441\u043b\u043e\t \tdef __getIntFromByteArray(self, sizeInt, stream): \t\tbyteArray = stream.read(sizeInt) # \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442\u043e\u0432, \u043e\u0442\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0434 \u0447\u0438\u0441\u043b\u043e \t\t \t\t# \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u0440\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442  \t\tformatCharacter = 'L'   # \u0424\u043e\u0440\u043c\u0430\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 &quot;unsigned long&quot; (\u0434\u043b\u044f sizeInt = 4) \t\tif sizeInt == 8: \t\t\tformatCharacter = 'Q' # \u0424\u043e\u0440\u043c\u0430\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 &quot;unsigned long long&quot; (\u0434\u043b\u044f sizeInt = 8) \t\tformat = '&gt;' + formatCharacter # \u041e\u0431\u0449\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437: &quot;\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0431\u0430\u0439\u0442\u043e\u0432&quot; + &quot;\u0444\u043e\u0440\u043c\u0430\u0442 \u0447\u0438\u0441\u043b\u0430&quot; \t\t# \u0421\u0442\u0440\u043e\u043a\u0430 '&gt;' - \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0431\u0430\u0439\u0442\u043a\u043e\u0434 \u0432 \u0447\u0438\u0441\u043b\u043e int(\u0440\u0430\u0437\u043c\u0435\u0440\u0430 formatCharacter) \u043e\u0442 \u0441\u0442\u0430\u0440\u0448\u0435\u0433\u043e \u0431\u0438\u0442\u0430 \u043a \u043c\u043b\u0430\u0434\u0448\u0435\u043c\u0443. \t\t \t\tinteger = (unpack(format, byteArray))[0] # \u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442\u043e\u0432 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435\t \t\treturn int(integer)  \t\t \t\t  \t# \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u0444\u0430\u0439\u043b .idx \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 (\u0437\u0430\u043f\u0438\u0441\u044c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 3-\u0445 \u043f\u043e\u043b\u0435\u0439) \u0438 \u043a\u0430\u0436\u0434\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c self.idxDict \tdef __FillIdxDict(self): \t\tlanguageWord = &quot;&quot; \t\twith open(self.dictionaryFile, 'rb') as stream: \t\t\twhile True: \t\t\t\tbyte = stream.read(1)  # \u0427\u0438\u0442\u0430\u0435\u043c \u043e\u0434\u0438\u043d \u0431\u0430\u0439\u0442 \t\t\t\tif not byte: break # \u0415\u0441\u043b\u0438 \u0431\u0430\u0439\u0442\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0442, \u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u0446\u0438\u043a\u043b\u0430 \t\t\t\tif byte != b'\\0':\t # \u0415\u0441\u043b\u0438 \u0431\u0430\u0439\u0442 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u0438 '\\0', \u0442\u043e \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u043a \u0441\u043b\u043e\u0432\u0443 \t\t\t\t\tlanguageWord += byte.decode(&quot;utf-8&quot;) \t\t\t\telse:  \t\t\t\t\t# \u0415\u0441\u043b\u0438 \u0434\u043e\u0448\u043b\u0438 \u0434\u043e '\\0', \u0442\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u043b\u043e\u0432\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0434\u0443\u0442 \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 (&quot;\u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 dict&quot; \u0438 &quot;\u0420\u0430\u0437\u043c\u0435\u0440 \u0432\u0441\u0435\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 dict&quot;) \t\t\t\t\twordDataOffset = self.__getIntFromByteArray(self.idxOffsetBytes, stream)  # \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u0435\u0440\u0432\u043e\u0435 \u0447\u0438\u0441\u043b\u043e &quot;\u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 dict&quot; \t\t\t\t\twordDataSize = self.__getIntFromByteArray(4, stream) # \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432\u0442\u043e\u0440\u043e\u0435 \u0447\u0438\u0441\u043b\u043e &quot;\u0420\u0430\u0437\u043c\u0435\u0440 \u0432\u0441\u0435\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 dict&quot;  \t\t\t\t\tself.idxDict[languageWord] = [wordDataOffset, wordDataSize] # \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c self.idxDict \u0437\u0430\u043f\u0438\u0441\u044c: \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e + \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 + \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \t\t\t\t\tlanguageWord = &quot;&quot; # \u041e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0440\u0443\u0442\u0443\u0440\u0430 \t\t\t  \t\t\t \t# \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 .dict (&quot;\u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 dict&quot; \u0438 &quot;\u0420\u0430\u0437\u043c\u0435\u0440 \u0432\u0441\u0435\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 dict&quot;). \t# \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u043d\u0435\u0442, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 None \tdef GetLocationWord(self, word):\t\t\t \t\ttry: \t\t\treturn self.idxDict[word]\t\t \t\texcept KeyError: \t\t\treturn [None, None]\t <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043b\u0430\u0441\u0441 Dict.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*-    from StarDict.BaseStarDictItem import BaseStarDictItem  # \u041c\u0430\u0440\u043a\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u043c (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, sametypesequence = tm). # \u0412\u0438\u0434\u044b \u043e\u0434\u043d\u043e-\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044bx \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432  \u0441\u043b\u043e\u0432\u0430\u0440\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 (\u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0445 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0442\u0435\u043a\u0441\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 utf-8, \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f '\\0'): # 'm' - \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435\u043a\u0441\u0442 \u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 utf-8, \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f '\\0'  # 'l' - \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435\u043a\u0441\u0442 \u0432 \u041d\u0415 \u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 utf-8, \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f '\\0'  # 'g' - \u0442\u0435\u043a\u0441\u0442 \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044f\u0437\u044b\u043a\u0430 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 Pango # 't' - \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044f \u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 utf-8, \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f '\\0'  # 'x' - \u0442\u0435\u043a\u0441\u0442 \u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 utf-8, \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e xdxf # 'y' - \u0442\u0435\u043a\u0441\u0442 \u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 utf-8, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0435(YinBiao) \u0438\u043b\u0438 \u044f\u043f\u043e\u043d\u0441\u043a\u0438\u0435 (KANA) \u0441\u0438\u043c\u0432\u043e\u043b\u044b  # 'k' - \u0442\u0435\u043a\u0441\u0442 \u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 utf-8, \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e  KingSoft PowerWord XML  # 'w' - \u0442\u0435\u043a\u0441\u0442 \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e  MediaWiki # 'h' - \u0442\u0435\u043a\u0441\u0442 \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e  Html # 'n' - \u0442\u0435\u043a\u0441\u0442 \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u043b\u044f WordNet # 'r' - \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0420\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 (jpg), \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0435 (wav), \u0432\u0438\u0434\u0435\u043e (avi), \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435(bin) \u0444\u0430\u0439\u043b\u044b \u0438 \u0434\u0440. # 'W' - wav \u0444\u0430\u0439\u043b # 'P' - \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 # 'X' - \u044d\u0442\u043e\u0442 \u0442\u0438\u043f \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439    class Dict(BaseStarDictItem): \tdef __init__(self, pathToDict, sameTypeSequence):  \t\t# \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f (BaseStarDictItem) \t\tBaseStarDictItem.__init__(self, pathToDict, 'dict') \t \t\t# \u041c\u0430\u0440\u043a\u0435\u0440, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \t\tself.sameTypeSequence = sameTypeSequence  \t\t  \t\t\t \tdef\tGetTranslation(self, wordDataOffset, wordDataSize): \t\ttry: \t\t\t# \u0423\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f \u0447\u0442\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b \u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0444\u0430\u0439\u043b\u0430 .dict \t\t\tself.__CheckValidArguments(wordDataOffset, wordDataSize)  \t\t\t# \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b .dict \u043a\u0430\u043a \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \t\t\twith open(self.dictionaryFile, 'rb') as file:  # \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \t\t\t\tfile.seek(wordDataOffset) # \u0421\u043c\u0435\u0448\u0430\u0435\u043c\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0430\u0439\u043b\u0430 \u0434\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0442\u0435\u043a\u0441\u0442\u0430, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0435\u0433\u043e\u0441\u044f \u043a \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0443 \u0441\u043b\u043e\u0432\u0430 \t\t\t\tbyteArray = file.read(wordDataSize) # \u0427\u0438\u0442\u0430\u0435\u043c \u0447\u0430\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u0430, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0435\u0433\u043e\u0441\u044f \u043a \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0443 \u0441\u043b\u043e\u0432\u0430 \t\t\t\treturn byteArray.decode(self.encoding) # \u0412\u0435\u0440\u043d\u0435\u043c \u0440\u0430\u0441\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 \u044e\u043d\u0438\u043a\u043e\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430\u0431\u043e\u0440 \u0431\u0430\u0439\u0442o\u0432 (self.encoding \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 BaseDictionaryItem) \t \t\texcept Exception: \t\t\treturn None\t  \t \t  \tdef\t__CheckValidArguments(self, wordDataOffset, wordDataSize):\t \t\tif wordDataOffset is None: \t\t\tpass \t\tif wordDataOffset &lt; 0: \t\t\tpass \t\tendDataSize = wordDataOffset + wordDataSize \t\tif wordDataOffset &lt; 0 or wordDataSize &lt; 0 or endDataSize &gt; self.realFileSize: \t\t\traise Exception <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0443 \u0432\u043e\u0442, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a \u0433\u043e\u0442\u043e\u0432. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043b\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u0439\u043b main.py \u0438 \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a Settings.ini.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u0439\u043b main.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*-   import os import xlwt3 as xlwt  from Frequency.IniParser import IniParser from Frequency.FrequencyDict import FrequencyDict from StarDict.StarDict import StarDict  ConfigFileName=&quot;Settings.ini&quot;  class Main: \tdef __init__(self): \t \t\tself.listLanguageDict = [] # \u0412 \u044d\u0442\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u0438 StarDict \t\tself.result = [] # \u0412 \u044d\u0442\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u0441\u0430\u043c\u043e \u0441\u043b\u043e\u0432\u043e, \u0447\u0430\u0441\u0442\u043e\u0442\u0430, \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434)  \t\ttry: \t\t\t# \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433-\u043f\u0430\u0440\u0441\u0435\u0440 \t\t\tconfig = IniParser(ConfigFileName)\t  \t\t\tself.pathToBooks = config.GetValue(&quot;PathToBooks&quot;) # \u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0437 ini \u0444\u0430\u0439\u043b\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e PathToBooks, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442  \u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u043e\u0432(\u043a\u043d\u0438\u0433, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0442\u0434), \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u043e\u0432\u0430\t\t \t\t\tself.pathResult = config.GetValue(&quot;PathToResult&quot;) # \u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0437 ini \u0444\u0430\u0439\u043b\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e PathToResult, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0443\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \t\t\tself.countWord = config.GetValue(&quot;CountWord&quot;) # \u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0437 ini \u0444\u0430\u0439\u043b\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e CountWord, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \t\t\tself.pathToWordNetDict = config.GetValue(&quot;PathToWordNetDict&quot;) # \u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0437 ini \u0444\u0430\u0439\u043b\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e PathToWordNetDict, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0443\u0442\u044c \u0434\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f WordNet \t\t\tself.pathToStarDict = config.GetValue(&quot;PathToStarDict&quot;) # \u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0437 ini \u0444\u0430\u0439\u043b\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e PathToStarDict, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0443\u0442\u044c \u0434\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 StarDict\t \t\t\t \t\t\t# \u041e\u0442\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0443\u0442\u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 StarDict \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430 \u043f\u0443\u0442\u0438. \u0412\u0441\u0435 \u043f\u0443\u0442\u0438 \u0437\u0430\u043d\u043e\u0441\u0438\u043c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a listPathToStarDict \t\t\tlistPathToStarDict = [item.strip() for item in self.pathToStarDict.split(&quot;;&quot;)]  \t\t\t# \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043f\u0443\u0442\u0435\u0439 \u0434\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 StarDict \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0432\u043e\u0439 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \t\t\tfor path in listPathToStarDict: \t\t\t\tlanguageDict = StarDict(path) \t\t\t\tself.listLanguageDict.append(languageDict)  \t\t\t \t\t\t# \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043d\u0438\u0433, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430 \t\t\tself.listBooks = self.__GetAllFiles(self.pathToBooks)  \t\t\t# \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c\t\t \t\t\tself.frequencyDict = FrequencyDict(self.pathToWordNetDict)\t\t\t \t \t\t\t# \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0441\u043b\u043e\u0432\u0430\u0440\u0438 StarDict \u0438 WordNet. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b, \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430\t\t\t \t\t\tself.__Run() \t\t \t\texcept Exception as e: \t\t\tprint('Error: &quot;%s&quot;' %e)   \t# \u041c\u0435\u0442\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0432 \u043f\u0430\u043f\u043a\u0435 path\t \tdef __GetAllFiles(self, path): \t\ttry: \t\t\treturn [os.path.join(path, file) for file in os.listdir(path)] \t\texcept Exception: \t\t\traise Exception('Path &quot;%s&quot; does not exists' % path)\t\t  \t\t \t# \u041c\u0435\u0442\u043e\u0434 \u0431\u0435\u0436\u0438\u0442 \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u043c, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0438\u0437 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u043d\u0435\u0442 \u043d\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430\t \tdef __GetTranslate(self, word): \t\tvalueWord = &quot;&quot; \t\tfor dict in self.listLanguageDict: \t\t\tvalueWord = dict.Translate(word) \t\t\tif valueWord != &quot;&quot;: \t\t\t\treturn valueWord \t\treturn valueWord \t\t \t\t \t\t \t# \u041c\u0435\u0442\u043e\u0434 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442(\u0441\u0430\u043c\u043e \u0441\u043b\u043e\u0432\u043e, \u0447\u0430\u0441\u0442\u043e\u0442\u0430, \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434) \u043f\u043e \u043f\u0435\u0440\u0432\u044b\u043c countWord \u0441\u043b\u043e\u0432\u0430\u043c \u0432 \u0444\u0430\u0439\u043b \u0444\u043e\u0440\u043c\u0430\u0442\u0430 Excel  \t \tdef __SaveResultToExcel(self):\t \t\ttry: \t\t\tif not os.path.exists(self.pathResult): \t\t\t\traise Exception('No such directory: &quot;%s&quot;' %self.pathResult)\t \t\t\t \t\t\tif self.result:\t \t\t\t\tdescription = 'Frequency Dictionary' \t\t\t\tstyle = xlwt.easyxf('font: name Times New Roman')\t\t\t \t\t\t\twb = xlwt.Workbook() \t\t\t\tws = wb.add_sheet(description + ' ' + self.countWord)\t \t\t\t\tnRow = 0 \t\t\t\tfor item in self.result: \t\t\t\t\tws.write(nRow, 0, item[0], style) \t\t\t\t\tws.write(nRow, 1, item[1], style) \t\t\t\t\tws.write(nRow, 2, item[2], style) \t\t\t\t\tnRow +=1\t\t\t \t\t\t\twb.save(os.path.join(self.pathResult, description +'.xls')) \t\texcept Exception as e: \t\t\tprint(e)\t\t\t \t \t \t \t# \u041c\u0435\u0442\u043e\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \tdef __Run(self):\t\t\t\t\t \t\t# \u041e\u0442\u0434\u0430\u0435\u043c \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u043c\u0443 \u0441\u043b\u043e\u0432\u0430\u0440\u044e \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0435\t \t\tfor book in self.listBooks: \t\t\tself.frequencyDict.ParseBook(book)\t\t \t\t\t \t\t# \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0435 countWord \u0441\u043b\u043e\u0432 \u0438\u0437 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432\t\t\t \t\tmostCommonElements = self.frequencyDict.FindMostCommonElements(self.countWord) \t\t \t\t# \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043b\u043e\u0432 \t\tfor item in mostCommonElements: \t\t\tword = item[0] \t\t\tcounterWord = item[1] \t\t\tvalueWord = self.__GetTranslate(word) \t\t\tself.result.append([counterWord, word, valueWord])\t  \t\t# \u0417\u0430\u043f\u0438\u0448\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0444\u0430\u0439\u043b \u0444\u043e\u0440\u043c\u0430\u0442\u0430 Excel  \t\tself.__SaveResultToExcel()\t\t   if __name__ == &quot;__main__&quot;: \tmain = Main() <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a Settings.ini<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">; \u041f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u043e\u0432(\u043a\u043d\u0438\u0433, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0442\u0434), \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u043e\u0432\u0430 PathToBooks = e:\\Bienne\\Frequency\\Books  ; \u041f\u0443\u0442\u044c \u0434\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f WordNet(\u043e\u043d \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0432) PathToWordNetDict = e:\\Bienne\\Frequency\\WordNet\\wn3.1.dict\\  ; \u041f\u0443\u0442\u044c \u0434\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 StarDict(\u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441\u043b\u043e\u0432) PathToStarDict = e:\\Bienne\\Frequency\\Dict\\stardict-comn_dictd04_korolew  ; \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 Excel CountWord = 100  ; \u041f\u0443\u0442\u044c, \u043a\u0443\u0434\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 Excel \u0441 \u0442\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c\u0438 - \u0441\u0430\u043c\u043e \u0441\u043b\u043e\u0432\u043e, \u0447\u0430\u0441\u0442\u043e\u0442\u0430, \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434) PathToResult = e:\\Bienne\\Frequency\\Books <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <b>xlwt<\/b>, \u043e\u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 Excel (\u0442\u0443\u0434\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442).<br \/>  \u0412 \u0444\u0430\u0439\u043b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a Settings.ini \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 PathToStarDict \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 &quot;;&quot;. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043b\u043e\u0432\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0441\u0442\u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u2014 \u0435\u0441\u043b\u0438 \u0441\u043b\u043e\u0432\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u0435, \u043f\u043e\u0438\u0441\u043a \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0438\u043d\u0430\u0447\u0435 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 StarDict.<\/p>\n<h4>\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435<\/h4>\n<p>  \u0412\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/Bienne\/Frequency\">github<\/a>.<br \/>  \u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435:  <\/p>\n<ol>\n<li>\u0421\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u043f\u043e\u0434 <b>windows<\/b>;<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f <b>python 3.3<\/b>;<\/li>\n<li>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <b>xlwt <\/b>\u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Excel; <\/li>\n<li>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430\u0440\u043d\u044b\u0435 \u0431\u0430\u0437\u044b \u0434\u043b\u044f <b>WordNet <\/b>\u0438 <b>StarDict<\/b> (\u0443 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 StarDict \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 \u0430\u0440\u0445\u0438\u0432 \u0444\u0430\u0439\u043b\u044b \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c dict);<\/li>\n<li>\u0412 \u0444\u0430\u0439\u043b\u0435 <b>Settings.ini <\/b> \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0443\u0442\u0438 \u0434\u043b\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0438 \u043a\u0443\u0434\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/li>\n<li>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044e, \u043e\u043d\u0430 \u0435\u0441\u0442\u044c \u043d\u0435 \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u043d\u044b\u0445 \u0431\u0430\u0437\u0430\u0445 StarDict, \u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u0435\u0439 \u043f\u043e \u043f\u043e\u0438\u0441\u043a\u0443 \u0432 \u0433\u0443\u0433\u043b\u0435 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430 (\u0432\u043e \u0432\u0441\u044f\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f \u0438\u0445 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0430).<\/li>\n<\/ol>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/161073\/\"> http:\/\/habrahabr.ru\/post\/161073\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u0440\u0438\u0432\u0435\u0442 \u0432\u0441\u0435\u043c!<br \/>  \u042f \u0443\u0447\u0443 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439 \u0438 \u0432\u0441\u044f\u0447\u0435\u0441\u043a\u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u044e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041a\u0430\u043a\u0442\u043e \u043c\u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043b\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0438 \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430. \u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u0431\u044b\u043b\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0439, \u0438 \u044f \u043f\u0440\u0438\u043d\u044f\u043b\u0430\u0441\u044c \u0437\u0430 \u0434\u0435\u043b\u043e. \u0427\u0443\u0442\u044c \u043f\u043e\u0437\u0434\u043d\u0435\u0435 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 <b>python<\/b>, \u0432\u0441\u0435 \u044d\u0442\u043e \u0443\u043c\u0435\u044e\u0449\u0438\u0439, \u0438 \u0434\u0430\u0436\u0435 \u0443\u043c\u0435\u044e\u0449\u0438\u0439 \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0449\u0435 \u0438 \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0438\u0437 \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438. \u0422\u0430\u043a \u0432\u044b\u0448\u0435\u043b \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043d\u0430\u0431\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0438 \u0445\u043e\u0442\u0435\u043b\u0430 \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c. <br \/>  \u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0432\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432, \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0445, \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0435 \u0438 \u0432\u044b\u0434\u0430\u0447\u0438 \u043f\u0435\u0440\u0432\u044bx countWord \u0441\u043b\u043e\u0432 \u0438\u0437 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432. <br \/>  \u0412 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0441\u043b\u043e\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435:<br \/>  <b>[\u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439] [\u0441\u0430\u043c\u043e \u0441\u043b\u043e\u0432\u043e] [\u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u043b\u043e\u0432\u0430]<\/b><\/p>\n<p>  \u041e \u0447\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u043b\u044c\u0448\u0435:  <\/p>\n<ol>\n<li>\u041c\u044b \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <b>\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/b>);<\/li>\n<li>\u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445 \u0441 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b \u0432 \u0442\u043e\u0442 \u0432\u0438\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u0445 (\u0442\u0443\u0442 \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0438\u043c \u0444\u043e\u0440\u043c\u0430\u0442 <b>WordNet<\/b>);<\/li>\n<li>\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u0443 \u0432\u0441\u0435\u0445 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043b\u043e\u0432 (\u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e);<\/li>\n<li>\u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0443\u0433\u043b\u0443\u0431\u0438\u043c\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 <b>StarDict<\/b>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u0438 \u0442\u0440\u0430\u043d\u0441\u043a\u0440\u0438\u043f\u0446\u0438\u044e.<\/li>\n<li>\u041d\u0443 \u0438 \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 \u043c\u044b \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u044f \u0432\u044b\u0431\u0440\u0430\u043b\u0430 \u0444\u0430\u0439\u043b \u0444\u043e\u0440\u043c\u0430\u0442\u0430 <b>Excel<\/b>).<\/li>\n<\/ol>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-161073","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/161073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=161073"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/161073\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=161073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=161073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=161073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}