Skip to content
Back to skills

Fullwidth Halfwidth Normalizer

ASecurity

全角/半角字符规范化工具。读取结构化数据文件,将文本中的全角ASCII字符(字母、数字、标点)转换为半角形式, 并可按需执行指定 Unicode 正规化。适用于中日韩混排科研文本的统一预处理,不负责空白行删除、拼写纠错或重复标点合并。 当用户提到全角转半角、半角规范化、全半角统一、全角字母数字转换等需求时使用此skill。

  • 539 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added September 11, 2026
datapythonbash

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add cas-bigdatalab/piflow --skill fullwidth_halfwidth_normalizer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Fullwidth Halfwidth Normalizer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Fullwidth Halfwidth Normalizer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/cas-bigdatalab-fullwidth-halfwidth-normalizer/badge)](https://www.skillsdirectory.com/skills/cas-bigdatalab-fullwidth-halfwidth-normalizer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: fullwidth_halfwidth_normalizer
description: |
  全角/半角字符规范化工具。读取结构化数据文件,将文本中的全角ASCII字符(字母、数字、标点)转换为半角形式,
  并可按需执行指定 Unicode 正规化。适用于中日韩混排科研文本的统一预处理,不负责空白行删除、拼写纠错或重复标点合并。
  当用户提到全角转半角、半角规范化、全半角统一、全角字母数字转换等需求时使用此skill。
name_zh: fullwidth_halfwidth_normalizer_全角半角规范化算子
input_params:
  - name: input_path
    type: string
    required: true
    description: 输入文件路径(支持CSV/TSV/Excel等)
  - name: output_path
    type: string
    required: true
    description: 输出文件路径
  - name: text_columns
    type: string
    required: false
    description: 处理的文本列,逗号分隔;默认全部字符串列
  - name: norm_form
    type: string
    required: false
    description: Unicode正规化形式:NFC/NFD/NFKC/NFKD;默认不执行
  - name: keep_newlines
    type: string
    required: false
    description: 保留换行符(默认折叠为空格)
output_params:
  - name: output_path
    type: csv_file
    description: 全角转半角后的结构化数据文件
tag: 数据清洗
publisher: COMMUNITY
---

# fullwidth_halfwidth_normalizer 全角半角规范化Skill

## 功能概述

将文本中的全角 ASCII 字符(U+FF01-U+FF5E、U+3000)转换为半角形式,并支持可选的 Unicode 正规化处理。覆盖字母、数字、标点符号的全半角统一,中文专属标点(。、【】、《》等)不受影响。

## 触发条件

- 全角转半角
- 半角规范化
- 全半角统一
- 全角字母/数字/标点转换
- Unicode 正规化
- 中日韩混排文本清洗

## 输入文件格式

- CSV (.csv) / TSV (.tsv) / Excel (.xls, .xlsx) / SPSS (.sav)

## 使用方法

### 步骤1:获取用户输入输出路径

向用户确认:
1. 输入文件路径(需要处理的文件)
2. 输出文件路径(处理后的文件)
3. 可选:指定处理的文本列
4. 可选:Unicode正规化形式

### 步骤2:执行全角半角规范化脚本

在 `scripts/` 目录下找到 `fullwidth_halfwidth_normalizer.py`,使用Python执行:

基本用法:
```bash
python scripts/fullwidth_halfwidth_normalizer.py \
    --input_path <输入文件> \
    --output_path <输出文件>
```

带可选参数:
```bash
python scripts/fullwidth_halfwidth_normalizer.py \
    --input_path <输入文件> \
    --output_path <输出文件> \
    --text_columns col1,col2 \
    --norm_form NFKC \
    --keep_newlines
```

### 步骤3:返回结果

脚本执行完成后,告知用户全角字符转换数量和输出文件路径。

## 核心参数说明

### 必需参数

| 参数 | 说明 |
|------|------|
| `--input_path` | 输入结构化文件路径 |
| `--output_path` | 输出规范化后文件路径 |

### 可选参数

`--text_columns` 指定规范化列,其他参数控制转换方向和字符范围。

## 参数说明

| 参数 | 必填 | 说明 |
|------|------|------|
| `--input_path` | 是 | 输入文件路径 |
| `--output_path` | 是 | 输出文件路径 |
| `--text_columns` | 否 | 处理的文本列,逗号分隔 |
| `--norm_form` | 否 | NFC/NFD/NFKC/NFKD |
| `--keep_newlines` | 否 | 保留换行符 |

## 输出示例

```
[OK] 全角/半角规范化完成 -> output.csv
   文本列: ['text']
   norm_form=无, keep_newlines=False
```

输入 `2024年,AI技术` → 输出 `2024年,AI技术`

## 环境要求

使用项目 Python 环境运行,依赖 pandas 和共享 `data_io` 读写工具。

## 注意事项

1. 仅转换 U+FF01-U+FF5E 范围内的全角 ASCII 字符和 U+3000 全角空格
2. 中文专属标点(。、【】、《》、——等)不受影响
3. NFKC 正规化会一并处理全角字符和其他兼容字符
4. 默认折叠换行为空格,使用 `--keep_newlines` 可保留

Files in this skill

  • SKILL.md3.9 KB
  • scripts/data_io.py3.5 KB
  • scripts/fullwidth_halfwidth_normalizer.py4.2 KB
  • skill.json2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.