{"id":283336,"date":"2016-12-31T22:55:03","date_gmt":"2016-12-31T19:55:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=283336"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=283336","title":{"rendered":"\u041a\u0430\u043a \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e?"},"content":{"rendered":"<p>\u0411\u043b\u0438\u0437\u0438\u0442\u0441\u044f \u041d\u043e\u0432\u044b\u0439 \u0413\u043e\u0434. \u0412 \u0425\u0430\u0431\u0430\u0440\u043e\u0432\u0441\u043a\u0435 \u043e\u043d \u0443\u0436\u0435 \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b, \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e!<\/p>\n<p>  \u041f\u043e \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0438, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0432\u0435\u0441\u0442\u0438 \u0438\u0442\u043e\u0433\u0438 \u0443\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0433\u043e\u0434\u0430, \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u043e\u0441\u0442\u044b. \u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c-\u0442\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u043b, \u043d\u043e \u043a\u0430\u043a \u0438\u0445 \u043e\u0446\u0435\u043d\u0438\u0442\u044c? \u041a\u0430\u0440\u043c\u0430? \u0420\u0435\u0439\u0442\u0438\u043d\u0433? \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u044b? \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0443\u0445\u043e \u0438 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e. \u041f\u043e\u043f\u0443\u0433\u0430\u0438? \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043d\u0435\u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e. \u042f \u0440\u0435\u0448\u0438\u043b \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c \u0432 Milfgard-\u0430\u0445.<\/p>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u041c\u0435\u0442\u043e\u0434\u0438\u043a\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f: \u0434\u043e\u0441\u0442\u0430\u0435\u043c \u043f\u043e\u0441\u0442\u044b <a href=\"https:\/\/habrahabr.ru\/users\/milfgard\/\" class=\"user_link\">Milfgard<\/a>, \u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u043a\u0432. \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 \u0444\u043e\u043d\u043e\u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430.  <\/p>\n<pre><code class=\"cs\">public static class SymbolsExtractor     {         private static readonly char[] _russianSymbols = &quot;\u0430\u0431\u0432\u0433\u0434\u0435\u0451\u0436\u0437\u0438\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f&quot;.ToCharArray(); \/\/ 32 \u0440\u0443\u0441\u0441\u043a\u0438\u0445 \u0431\u0443\u043a\u0432\u044b         public static char[] RussianSymbols =&gt; _russianSymbols.ToArray();          public static Dictionary&lt;char, double&gt; SymbolsFrequences(this string text)         {             var symbolsQty = text.ToCharArray().Count(symbol =&gt; _russianSymbols.Contains(symbol)); \/\/ \u0414\u043b\u0438\u043d\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 (\u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0440\u0443\u0441\u0441\u043a\u0438\u0435 \u0431\u0443\u043a\u0432\u044b)             double symbolPercentage = 1.00\/symbolsQty;               var result = new Dictionary&lt;char, double&gt;();             foreach (char russianSymbol in _russianSymbols)             {                 double inclusions = text.ToLower().ToCharArray()                      .Count(textSymbol =&gt; textSymbol == russianSymbol) \/\/ \u0421\u0447\u0438\u0442\u0430\u0435\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0431\u0443\u043a\u0432\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u043a\u0441\u0442\u0435                     * (symbolPercentage); \/\/ \u0414\u0435\u043b\u0438\u043c \u043d\u0430 \u0434\u043b\u0438\u043d\u0443 \u0442\u0435\u043a\u0441\u0442\u0430                 inclusions = Math.Round(inclusions, 3); \/\/ \u041e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u043c \u0434\u043e \u0434\u043e\u043b\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430                 result.Add(russianSymbol, inclusions);             }              return result; \/\/ \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435: \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438 \u0438\u0445 \u0447\u0430\u0441\u0442\u043e\u0442\u044b         }      }<\/code><\/pre>\n<p>  \u042f \u0432\u0437\u044f\u043b \u043f\u044f\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u043f\u043e\u0441\u0442\u043e\u0432, \u043f\u044f\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0445, \u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b \u043c\u0435\u0434\u0438\u0430\u043d\u044b. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u0411\u0443\u043a\u0432\u0430-\u0420\u0430\u043d\u043d\u0438\u0439 \u041c\u0438\u043b\u0444\u0433\u0430\u0440\u0434-\u041f\u043e\u0437\u0434\u043d\u0438\u0439 \u041c\u0438\u043b\u0444\u0433\u0430\u0440\u0434):  <\/p>\n<table>\n<tr>\n<td>\u0430<\/td>\n<td>0.0864<\/td>\n<td>0.09<\/td>\n<\/tr>\n<tr>\n<td>\u0431<\/td>\n<td>0.0148<\/td>\n<td>0.0172<\/td>\n<\/tr>\n<tr>\n<td>\u0432<\/td>\n<td>0.043<\/td>\n<td>0.0388<\/td>\n<\/tr>\n<tr>\n<td>\u0433<\/td>\n<td>0.0164<\/td>\n<td>0.0166<\/td>\n<\/tr>\n<tr>\n<td>\u0434<\/td>\n<td>0.0294<\/td>\n<td>0.0292<\/td>\n<\/tr>\n<tr>\n<td>&#8230;<\/td>\n<\/tr>\n<tr>\n<td>\u044a<\/td>\n<td>0<\/td>\n<td> 0<\/td>\n<\/tr>\n<tr>\n<td>\u044b<\/td>\n<td>0.0228<\/td>\n<td>0.0204<\/td>\n<\/tr>\n<tr>\n<td>\u044c<\/td>\n<td>0.0176<\/td>\n<td>0.0186<\/td>\n<\/tr>\n<tr>\n<td>\u044d<\/td>\n<td>0.0038<\/td>\n<td>0.0042<\/td>\n<\/tr>\n<tr>\n<td>\u044e<\/td>\n<td>0.0064<\/td>\n<td>0.0058<\/td>\n<\/tr>\n<tr>\n<td>\u044f<\/td>\n<td>0.0186<\/td>\n<td>0.018<\/td>\n<\/tr>\n<\/table>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0435\u0441\u0442\u044c. \u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043d\u0430\u0434\u043e \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c\u0438 \u043f\u043e\u0441\u0442\u0430\u043c\u0438, \u044f \u0436\u0435 \u043f\u0440\u043e\u0432\u043e\u0436\u0430\u044e 2016 \u0433\u043e\u0434. \u0421\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043d\u0430\u0434\u043e \u0431\u044b\u0441\u0442\u0440\u043e: \u0447\u0435\u0440\u0435\u0437 \u0434\u0432\u0430 \u0447\u0430\u0441\u0430 \u0437\u0430 \u0441\u0442\u043e\u043b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u043c\u0435\u0434\u0438\u0430\u043d\u044b \u041c\u0438\u043b\u0444\u0433\u0430\u0440\u0434\u0430 \u043d\u0435 \u043a\u0430\u0442\u0438\u0442. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0435\u0440\u0443 \u043c\u0435\u0434\u0438\u0430\u043d\u0443 \u043e\u0442 \u043f\u043e\u0441\u0442\u043e\u0432 <a href=\"https:\/\/habrahabr.ru\/users\/alizar\/\" class=\"user_link\">Alizar<\/a>, \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e \u0441\u0432\u043e\u044e \u043c\u0435\u0434\u0438\u0430\u043d\u0443 \u0441 \u041c\u0438\u043b\u0444\u0433\u0430\u0440\u0434\u043e\u0432\u043e\u0439 \u0438 \u0410\u043b\u0438\u0437\u0430\u0440\u043e\u0432\u043e\u0439.<\/p>\n<pre><code class=\"cs\">int result = 0;              foreach (var stat in stats)             {                 double MilfgardDiff = Math.Abs(stat.NewMilfgard - stat.Oxoron); \/\/ \u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e \u043c\u0435\u0434\u0438\u0430\u043d\u044b: \u043c\u043e\u044e \u0438 Milfgard                 double AlizarDiff = Math.Abs(stat.Alizar - stat.Oxoron); \/\/ \u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e \u043c\u0435\u0434\u0438\u0430\u043d\u044b: \u043c\u043e\u044e \u0438 Alizar                 char res = MilfgardDiff &gt; AlizarDiff ? 'M'                                                                    : Math.Abs(MilfgardDiff - AlizarDiff) &lt; 0.0001 ? 'N'                                                                    : 'A';                 if (res == 'M') result++;  \/\/ \u0411\u043b\u0438\u0436\u0435 \u043a Milfgard                 if (res == 'A') result--; \/\/ \u0411\u043b\u0438\u0436\u0435 \u043a Alizar                         }              Console.WriteLine();             Console.WriteLine(result &lt; 0 ? $&quot;{-result} ALizar&quot; : $&quot;{result} Milfgard&quot;); \/\/ \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0414\u043b\u044f \u043c\u0435\u043d\u044f - 8 Alizar <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043e\u0446\u0435\u043d\u043a\u0438 \u043f\u0440\u043e\u0441\u0442 \u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u0435\u043d. \u041e\u0431\u043b\u0430\u0441\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u0448\u0438\u0440\u043e\u043a\u0430: \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0435 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0441 \u0434\u0436\u0430\u0432\u0438\u0441\u0442\u0430\u043c\u0438 \u0438 \u0448\u0430\u0440\u043f\u0438\u0441\u0442\u0430\u043c\u0438, \u0440\u0443\u0431\u0438\u0441\u0442\u0430\u043c\u0438 \u0438 \u043f\u0445\u043f\u0435\u0448\u043d\u0438\u043a\u0430\u043c\u0438, \u044d\u0444\u0428\u0430\u0440\u043f\u0438\u0441\u0442\u0430\u043c\u0438 \u0438 \u0445\u0430\u0441\u043a\u0435\u043b\u0438\u0441\u0442\u0430\u043c\u0438. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a JS \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0432\u0430\u0448\u0435\u0439 \u043b\u0438\u0447\u043d\u043e\u0441\u0442\u0438. \u041d\u043e \u043a\u0430\u043a\u043e\u0439 \u0431\u044b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435 \u0432\u044b\u0448\u0435\u043b \u2014 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0435\u0441\u044c \u043a \u043d\u043e\u0432\u044b\u043c \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c, \u043a\u043e\u043b\u043b\u0435\u0433\u0438, \u0447\u0442\u043e\u0431\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u043b\u044e\u0434\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043b\u0438 \u0441\u0435\u0431\u044f \u0441 \u0432\u0430\u043c\u0438. \u0421 \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u043e\u043c!<\/p>\n<p>  P. S. Milfgard \u0438 Alizar \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u0430\u043a \u043e\u0434\u043d\u0438 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u0445\u0430\u0431\u0440\u044b.<br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/318864\/\"> https:\/\/habrahabr.ru\/post\/318864\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0411\u043b\u0438\u0437\u0438\u0442\u0441\u044f \u041d\u043e\u0432\u044b\u0439 \u0413\u043e\u0434. \u0412 \u0425\u0430\u0431\u0430\u0440\u043e\u0432\u0441\u043a\u0435 \u043e\u043d \u0443\u0436\u0435 \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b, \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e!<\/p>\n<p>  \u041f\u043e \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0438, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0432\u0435\u0441\u0442\u0438 \u0438\u0442\u043e\u0433\u0438 \u0443\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0433\u043e\u0434\u0430, \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u043e\u0441\u0442\u044b. \u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c-\u0442\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u043b, \u043d\u043e \u043a\u0430\u043a \u0438\u0445 \u043e\u0446\u0435\u043d\u0438\u0442\u044c? \u041a\u0430\u0440\u043c\u0430? \u0420\u0435\u0439\u0442\u0438\u043d\u0433? \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u044b? \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0443\u0445\u043e \u0438 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e. \u041f\u043e\u043f\u0443\u0433\u0430\u0438? \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043d\u0435\u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e. \u042f \u0440\u0435\u0448\u0438\u043b \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c \u0432 Milfgard-\u0430\u0445.<\/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-283336","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283336","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=283336"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283336\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}