前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >JCJC错别字检测系统接口API文档-添加错误词与正确词匹配

JCJC错别字检测系统接口API文档-添加错误词与正确词匹配

作者头像
田春峰-JCJC错别字检测
发布2023-12-20 09:51:32
1920
发布2023-12-20 09:51:32
举报
文章被收录于专栏:字根中文校对软件

JCJC错别字检测系统接口API文档更新,字典功能新增:错误词与正确词匹配

JCJC错别字检测功能字典支持类型:

  • 1)黑名单(敏感词)
  • 2)白名单
  • 3)配对词:正确词 -> 错误词

Python 示例代码如下:

代码语言:javascript
复制
# coding=utf8

import requests,json


# JCJC错别字检测系统接口API文档-添加错误词与正确词匹配



def call_jcjc_add_pair_words_right_to_wrong():
    msg_str_content_right = "正确词"
    msg_str_content_2_wrong = "错误配对词"
    payload = {
        "content": msg_str_content_right,
        "content2": msg_str_content_2_wrong,
        "mode": "advanced",
        "username": "用户名",
        "biz_type": "show",
    }
    host_and_port = "localhost:8631"   # 内网测试地址
    url = 'http://'+ host_and_port +'/spellcheck/add_pair_words_right_to_wrong'
    headers = {'content-type': 'application/json'}
    print("====>call payload ==>", json.dumps(payload))
    response = requests.post(url, data=json.dumps(payload), headers=headers)
    print("status:", response.status_code , response.encoding)

    returned_json_str=response.content

    print("raw http return string:", returned_json_str.decode('utf8'))

    print("if 乱码 please encoding : https://github.com/sunuslee/practical-python-utf8 ")

if __name__ == "__main__":
    call_jcjc_add_pair_words_right_to_wrong()

针对用户反馈,需要针对特殊的正确词与错误词配对提示的需求,我们新增了该接口。

接口地址为: /spellcheck/add_pair_words_right_to_wrong 。

参数说明:

  1. content: 正确词
  2. content2:错误词

词语新增完成后自动生效。

参考文档:

白名单、黑名单API 接口文档:

https://tianchunfeng.blog.csdn.net/article/details/116095794

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2023-12-19,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
腾讯云服务器利旧
云服务器(Cloud Virtual Machine,CVM)提供安全可靠的弹性计算服务。 您可以实时扩展或缩减计算资源,适应变化的业务需求,并只需按实际使用的资源计费。使用 CVM 可以极大降低您的软硬件采购成本,简化 IT 运维工作。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档