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

本文介绍了JCJC错别字检测系统的接口API更新,新增了错误词与正确词的配对功能,提供了Python示例代码,并附有黑名单、白名单API接口文档链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

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

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

Python 示例代码如下:

# 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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

JCJC错别字检测-田春峰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值