查詢英語單詞詳細信息-有道(一)

来源:https://www.cnblogs.com/kybs0/archive/2018/11/21/9992503.html
-Advertisement-
Play Games

有道翻譯有官方介面,也有非官方介面。 有道官方介面 官方介面:https://openapi.youdao.com/openapi 可查詢英語單詞註釋、單詞發音、網路釋義(不一定存在),可獲取線上發音地址。 具體使用,可參考 C# 有道API翻譯 查詢單詞詳細信息 有道非官方介面 何謂非官方介面,即 ...


有道翻譯有官方介面,也有非官方介面。

有道官方介面

官方介面:https://openapi.youdao.com/openapi

可查詢英語單詞註釋、單詞發音、網路釋義(不一定存在),可獲取線上發音地址。

具體使用,可參考 C# 有道API翻譯 查詢單詞詳細信息

有道非官方介面

何謂非官方介面,即不對外發佈、小範圍使用的介面。這種一般人都不知道的介面,官方不能保證數據的準確性

API介面:http://dict.youdao.com/jsonapi

拼接參數:

  • jsonversion:json 版本,目前已知取值12,返回結果大同小異。本文檔採用2
  • client:客戶端類型,取值mobile
  • q:查詢的單詞
  • dicts:需要查詢哪些字典(字典類型見下麵)。目前已知可為空,為空則返回全部欄位
  • keyfrommdict. + 版本號 + .手機平臺。可為空
  • model:手機型號。可為空
  • mid:平臺版本。可為空
  • imei:未知。可為空
  • vendor:應用下載平臺。可為空
  • screen:屏幕寬高。可為空
  • ssid:用戶名。可為空
  • network:網路狀態,取值 wifi4G5G
  • abtest:ab測試。可為空
  • xmlVersion:預設使用5.1

查詢字典類型包含幾十種:

 1 {
 2     "count": 99,
 3     "dicts": [
 4         [
 5             "ec",
 6             "ce",
 7             "newcj",
 8             "newjc",
 9             "kc",
10             "ck",
11             "fc",
12             "cf",
13             "multle",
14             "jtj",
15             "pic_dict",
16             "tc",
17             "ct",
18             "typos",
19             "special",
20             "tcb",
21             "baike",
22             "lang",
23             "simple",
24             "wordform",
25             "exam_dict",
26             "ctc",
27             "web_search",
28             "auth_sents_part",
29             "ec21",
30             "phrs",
31             "input",
32             "wikipedia_digest",
33             "ee",
34             "collins",
35             "ugc",
36             "media_sents_part",
37             "syno",
38             "rel_word",
39             "longman",
40             "ce_new",
41             "le",
42             "newcj_sents",
43             "blng_sents_part",
44             "hh"
45         ],
46         [
47             "ugc"
48         ],
49         [
50             "longman"
51         ],
52         [
53             "newjc"
54         ],
55         [
56             "newcj"
57         ],
58         [
59             "web_trans"
60         ],
61         [
62             "fanyi"
63         ]
64     ]
65 }
View Code

案例:查詢account單詞

http://dict.youdao.com/jsonapi?jsonversion=2&client=mobile&q=account&dicts=%7B%22count%22%3A99%2C%22dicts%22%3A%5B%5B%22ec%22%2C%22ce%22%2C%22newcj%22%2C%22newjc%22%2C%22kc%22%2C%22ck%22%2C%22fc%22%2C%22cf%22%2C%22multle%22%2C%22jtj%22%2C%22pic_dict%22%2C%22tc%22%2C%22ct%22%2C%22typos%22%2C%22special%22%2C%22tcb%22%2C%22baike%22%2C%22lang%22%2C%22simple%22%2C%22wordform%22%2C%22exam_dict%22%2C%22ctc%22%2C%22web_search%22%2C%22auth_sents_part%22%2C%22ec21%22%2C%22phrs%22%2C%22input%22%2C%22wikipedia_digest%22%2C%22ee%22%2C%22collins%22%2C%22ugc%22%2C%22media_sents_part%22%2C%22syno%22%2C%22rel_word%22%2C%22longman%22%2C%22ce_new%22%2C%22le%22%2C%22newcj_sents%22%2C%22blng_sents_part%22%2C%22hh%22%5D%2C%5B%22ugc%22%5D%2C%5B%22longman%22%5D%2C%5B%22newjc%22%5D%2C%5B%22newcj%22%5D%2C%5B%22web_trans%22%5D%2C%5B%22fanyi%22%5D%5D%7D&keyfrom=mdict.7.2.0.android&model=honor&mid=5.6.1&imei=659135764921685&vendor=wandoujia&screen=1080x1800&ssid=superman&network=wifi&abtest=2&xmlVersion=5.1 

詳細數據:

   1 {
   2     "auth_sents_part": {
   3         "more": "auth_sents",
   4         "sent": [
   5             {
   6                 "foreign": "This purchase will <b>account</b> for 39.5% of the outstanding shares of the brokerage following the issuance. ",
   7                 "score": 0.9831430912017822,
   8                 "source": "FORBES: <i>JP Morgan Sweetens Deal That Is Still Sour For Bear Investors</i>",
   9                 "speech": "This+purchase+will+account+for+39.5%25+of+the+outstanding+shares+of+the+brokerage+following+the+issuance.+",
  10                 "speech-size": "30kb",
  11                 "url": "http://www.forbes.com/2008/03/24/bear-stearns-jpmorgan-markets-equity-cx_po_0324markets06.html"
  12             },
  13             {
  14                 "foreign": "Spouse heirs, of course, can still claim the <b>account</b> as their own and name new heirs. ",
  15                 "score": 0.9831407070159912,
  16                 "source": "FORBES: <i>IRA Tips and Traps</i>",
  17                 "speech": "Spouse+heirs%2C+of+course%2C+can+still+claim+the+account+as+their+own+and+name+new+heirs.+",
  18                 "speech-size": "25kb",
  19                 "url": "http://www.forbes.com/forbes/2001/0611/216.html"
  20             },
  21             {
  22                 "foreign": "Best for having your frequent flier <b>account</b> balances within easy reach for spontaneous upgrades. ",
  23                 "score": 0.9831383228302002,
  24                 "source": "BBC: <i>Five best air travel apps</i>",
  25                 "speech": "Best+for+having+your+frequent+flier+account+balances+within+easy+reach+for+spontaneous+upgrades.+",
  26                 "speech-size": "28kb",
  27                 "url": "http://www.bbc.com/travel/story/20120619-five-best-air-travel-apps"
  28             }
  29         ],
  30         "sentence-count": 6
  31     },
  32     "blng_sents_part": {
  33         "more": "blng_sents",
  34         "sentence-count": 6,
  35         "sentence-pair": [
  36             {
  37                 "aligned-words": {
  38                     "src": {
  39                         "chars": [
  40                             {
  41                                 "@e": "4",
  42                                 "@id": "0",
  43                                 "@s": "1",
  44                                 "aligns": {
  45                                     "sc": [
  46                                         {
  47                                             "@id": "0"
  48                                         }
  49                                     ],
  50                                     "tc": [
  51                                         {
  52                                             "@id": "0"
  53                                         }
  54                                     ]
  55                                 }
  56                             },
  57                             {
  58                                 "@e": "12",
  59                                 "@id": "1",
  60                                 "@s": "5",
  61                                 "aligns": {
  62                                     "sc": [
  63                                         {
  64                                             "@id": "1"
  65                                         }
  66                                     ],
  67                                     "tc": [
  68                                         {
  69                                             "@id": "1"
  70                                         }
  71                                     ]
  72                                 },
  73                                 "q": [
  74                                     {
  75                                         "@e": "12",
  76                                         "@s": "5"
  77                                     }
  78                                 ]
  79                             },
  80                             {
  81                                 "@e": "32",
  82                                 "@id": "2",
  83                                 "@s": "13",
  84                                 "aligns": {
  85                                     "sc": [
  86                                         {
  87                                             "@id": "2"
  88                                         }
  89                                     ],
  90                                     "tc": [
  91                                         {
  92                                             "@id": "2"
  93                                         }
  94                                     ]
  95                                 }
  96                             }
  97                         ]
  98                     },
  99                     "tran": {
 100                         "chars": [
 101                             {
 102                                 "@e": "2",
 103                                 "@id": "0",
 104                                 "@s": "1",
 105                                 "aligns": {
 106                                     "sc": [
 107                                         {
 108                                             "@id": "0"
 109                                         }
 110                                     ],
 111                                     "tc": [
 112                                         {
 113                                             "@id": "0"
 114                                         }
 115                                     ]
 116                                 }
 117                             },
 118                             {
 119                                 "@e": "5",
 120                                 "@id": "1",
 121                                 "@s": "3",
 122                                 "aligns": {
 123                                     "sc": [
 124                                         {
 125                                             "@id": "1"
 126                                         }
 127                                     ],
 128                                     "tc": [
 129                                         {
 130                                             "@id": "1"
 131                                         }
 132                                     ]
 133                                 }
 134                             },
 135                             {
 136                                 "@e": "9",
 137                                 "@id": "2",
 138                                 "@s": "5",
 139                                 "aligns": {
 140                                     "sc": [
 141                                         {
 142                                             "@id": "2"
 143                                         }
 144                                     ],
 145                                     "tc": [
 146                                         {
 147                                             "@id": "2"
 148                                         }
 149                                     ]
 150                                 }
 151                             }
 152                         ]
 153                     }
 154                 },
 155                 "sentence": "His account contradicted itself.",
 156                 "sentence-eng": "His <b>account</b> contradicted itself.",
 157                 "sentence-speech": "His+account+contradicted+itself.&le=eng",
 158                 "sentence-translation": "他的解釋自相矛盾。",
 159                 "source": "《21世紀大英漢詞典》",
 160                 "speech-size": "9kb",
 161                 "url": "http://《21世紀大英漢詞典》/"
 162             },
 163             {
 164                 "aligned-words": {
 165                     "src": {
 166                         "chars": [
 167                             {
 168                                 "@e": "6",
 169                                 "@id": "0",
 170                                 "@s": "1",
 171                                 "aligns": {
 172                                     "sc": [
 173                                         {
 174                                             "@id": "0"
 175                                         }
 176                                     ],
 177                                     "tc": [
 178                                         {
 179                                             "@id": "0"
 180                                         }
 181                                     ]
 182                                 }
 183                             },
 184                             {
 185                                 "@e": "14",
 186                                 "@id": "1",
 187                                 "@s": "7",
 188                                 "aligns": {
 189                                     "sc": [
 190                                         {
 191                                             "@id": "1"
 192                                         }
 193                                     ],
 194                                     "tc": [
 195                                         {
 196                                             "@id": "1"
 197                                         }
 198                                     ]
 199                                 }
 200                             },
 201                             {
 202                                 "@e": "23",
 203                                 "@id": "2",
 204                                 "@s": "15",
 205                                 "aligns": {
 206                                     "sc": [
 207                                         {
 208                                             "@id": "2"
 209                                         }
 210                                     ],
 211                                     "tc": [
 212                                         {
 213                                             "@id": "5"
 214                                         }
 215                                     ]
 216                                 }
 217                             },
 218                             {
 219                                 "@e": "28",
 220                                 "@id": "3",
 221                                 "@s": "24",
 222                                 "aligns": {
 223                                     "sc": [
 224                                         {
 225                                             "@id": "3"
 226                                         }
 227                                     ],
 228                                     "tc": [
 229                                         {
 230                                             "@id": "2"
 231                                         }
 232                                     ]
 233                                 }
 234                             },
 235                             {
 236                                 "@e": "32",
 237                                 "@id": "4",
 238                                 "@s": "29",
 239                                 "aligns": {
 240                                     "sc": [
 241                                         {
 242                                             "@id": "4"
 243                                         }
 244                                     ],
 245                                     "tc": [
 246                                         {
 247                                             "@id": "3"
 248                                         }
 249                                     ]
 250                                 }
 251                             },
 252                             {
 253                                 "@e": "40",
 254                                 "@id": "5",
 255                                 "@s": "33",
 256                                 "aligns": {
 257                                     "sc": [
 258                                         {
 259                                             "@id": "5"
 260                                         }
 261                                     ],
 262                                     "tc": [
 263                                         {
 264                                             "@id": "4"
 265                                         }
 266                                     ]
 267                                 },
 268                                 "q": [
 269                                     {
 270                                         "@e": "40",
 271                                         "@s": "33"
 272                                     }
 273                                 ]
 274                             }
 275                         ]
 276                     },
 277                     "tran": {
 278                         "chars": [
 279                             {
 280                                 "@e": "3",
 281                                 "@id": "0",
 282                                 "@s": "1",
 283                                 "aligns": {
 284                                     "sc": [
 285                                         {
 286                                             "@id": "0"
 287                                         }
 288                                     ],
 289                                     "tc": [
 290                                         {
 291                                             "@id": "0"
 292                                         }
 293                                     ]
 294                                 }
 295                             },
 296                             {
 297                                 "@e": "5",
 298                                 "@id": "1",
 299                                 "@s": "3",
 300                                 "aligns": {
 301                                     "sc": [
 302                                         {
 303                                             "@id": "1"
 304                                         }
 305                                     ],
 306                                     "tc": [
 307                                         {
 308                                             "@id": "1"
 309                                         }
 310                                     ]
 311                                 }
 312                             },
 313                             {
 314                                 "@e": "6",
 315                                 "@id": "2",
 316                                 "@s": "5",
 317                                 "aligns": {
 318                                     "sc": [
 319                                         {
 320                                             "@id": "3"
 321                                         }
 322                                     ],
 323                                     "tc": [
 324                                         {
 325                                             "@id": "2"
 326                                         }
 327                                     ]
 328                                 }
 329                             },
 330                             {
 331                                 "@e": "8",
 332                                 "@id": "3",
 333                                 "@s": "6",
 334                                 "aligns": {
 335                                     "sc": [
 336                                         {
 337                                             "@id": "4"
 338                                         }
 339                                     ],
 340                                     "tc": [
 341                                         {
 342                                             "@id": "3"
 343                                         }
 344                                     ]
 345                                 }
 346                             },
 347                             {
 348                                 "@e": "11",
 349                                 "@id": "4",
 350                                 "@s": "9",
 351                                 "aligns": {
 352                                     "sc": [
 353                                         {
 354                                             "@id": "5"
 355                                         }
 356                                     ],
 357                                     "tc": [
 358                                         {
 359                                             "@id": "4"
 360                                         }
 361                                     ]
 362                                 }
 363                             },
 364                             {
 365                                 "@e": "13",
 366                                 "@id": "5",
 367                                 "@s": "11",
 368                                 "aligns": {
 369                                     "sc": [
 370                                         {
 371                                             "@id": "2"
 372                                         }
 373                                     ],
 374                                     "tc": [
 375                                         {
 376                                             "@id": "5"
 377                                         }
 378                                     ]
 379                                 }
 380                             }
 381                         ]
 382                     }
 383                 },
 384                 "sentence": "These figures disagree with our account.",
 385                 "sentence-eng": "These figures disagree with our <b>account</b>.",
 386                 "sentence-speech": "These+figures+disagree+with+our+account.&le=eng",
 387                 "sentence-translation": "這些數字與我們的賬單不符。",
 388                 "source": "《21世紀大英漢詞典》",
 389                 "speech-size": "11kb",
 390                 "url": "http://《21世紀大英漢詞典》/"
 391             },
 392             {
 393                 "aligned-words": {
 394                     "src": {
 395                         "chars": [
 396                             {
 397                                 "@e": "4",
 398                                 "@id": "0",
 399                                 "@s": "1",
 400                                 "aligns": {
 401                                     "sc": [
 402                                         {
 403                                             "@id": "0"
 404                                         }
 405                                     ],
 406                                     "tc": [
 407                                         {
 408                                             "@id": "0"
 409                                         },
 410                                         {
 411                                             "@id": "3"
 412                                         }
 413                                     ]
 414                                 }
 415                             },
 416                             {
 417                                 "@e": "9",
 418                                 "@id": "1",
 419                                 "@s": "5",
 420                                 "aligns": {
 421                                     "sc": [
 422                                         {
 423                                             "@id": "1"
 424                                         }
 425                                     ],
 426                                     "tc": [
 427                                         {
 428                                             "@id": "2"
 429                                         }
 430                                     ]
 431                                 }
 432                             },
 433                             {
 434                                 "@e": "17",
 435                                 "@id": "2",
 436                                 "@s": "10",
 437                                 "aligns": {
 438                                     "sc": [
 439                                         {
 440                                             "@id": "2"
 441                                         }
 442                                     ],
 443                                     "tc": [
 444                                         {
 445                                             "@id": "8"
 446                                         }
 447                                     ]
 448                                 },
 449                                 "q": [
 450                                     {
 451                                         "@e": "17",
 452                                         "@s": "10"
 453                                     }
 454                                 ]
 455                             },
 456    

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 概述 本篇文章將介紹C# 在PPT幻燈片中操作形狀(shape)的方法。這裡主要涉及常規形狀,如箭頭、矩形、圓形、三角形、多邊形、不規則形狀等。下麵的示例中,可以通過繪製形狀,並設置相應格式等。示例包含以下要點: 繪製形狀 用圖片填充形狀 在形狀中添加文字 設置形狀單色、漸變色填充 設置形狀陰影效果 ...
  • 因為之前寫RDLC 列印用的直接列印,複製網上的方法,列印出來以後會在根目錄下生成 一個EMF文件類型的文件,每次手動刪又很麻煩,所以做了一個控制台控制放在任務計劃裡面每天刪除emf文件。 既然要刪除指定文件 不可避免的要遍歷文件夾下的所有文件 1.首先要聲明文件目錄 2.聲明一個Directory ...
  • WPF自定義TabControl,TabControl美化 XAML代碼: <TabControl x:Class="SunCreate.Common.Controls.TabControlEx" xmlns="http://schemas.microsoft.com/winfx/2006/xaml ...
  • 資源文件代碼: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> ...
  • C# -- 交錯數組的使用 交錯數組是元素為數組的數組。交錯數組元素的維度和大小可以不同。交錯數組有時稱為“數組的數組”。 1. 舉例一:子數組是長度相同的一維數組 2. 舉例二:子數組是長度不同的一維數組 3. 舉例三:子數組是長度不同的二維數組 ...
  • 昨天遇到了很奇怪的一個bug,具體描述如下: 這個系統是c/s架構的針對多個工廠做的資材管理系統,由於有很多個工廠,每個工廠都有自己的伺服器。所以需要動態的改變連接字元串去鏈接不同的伺服器。 由於這個連接字元串放在了app.config文件中,所以公司上一個開發人員設置為,當選擇不同公司時會讓程式關 ...
  • 如果驗證出現如下錯誤 Failed to load /opt/dotnet/shared/Microsoft.NETCore.App/1.1.0/libcoreclr.so, error: libunwind.so.8: cannot open shared object file: No such ...
  • //測試環境office2016、office365 string InsertPath= @"E:\\新建文件夾\\2.xls";//插入的文檔路徑 string openfile = string.Empty; excelFileName = @"E:\\1.xls";//使用的文檔路徑 App ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...