I want to use only the normalization process of SudachiPy

I wanted to align the normalization process with SudachiPy, so I extracted only the relevant process.

from sudachipy import dictionary
from sudachipy.utf8inputtextbuilder import UTF8InputTextBuilder

dictionary = dictionary.Dictionary()
input_text_plugins = dictionary.input_text_plugins
grammar = dictionary.grammar

def normalize(text):
    builder = UTF8InputTextBuilder(text, grammar)
    for plugin in input_text_plugins:
        plugin.rewrite(builder)
    return builder.get_text()

if __name__ == '__main__':
    print(normalize('ABC123')) # -> abc123

Recommended Posts

I want to use only the normalization process of SudachiPy
I want to customize the appearance of zabbix
I want to use the activation function Mish
I want to use the Qore SDK to predict the success of NBA players
I want to grep the execution result of strace
I want to fully understand the basics of Bokeh
I want to use the R dataset in python
I want to increase the security of ssh connections
I want to use Python in the environment of pyenv + pipenv on Windows 10
I want to use PyTorch to generate something like the lyrics of Japari Park
I want to use the latest gcc without sudo privileges! !!
I want to get the operation information of yahoo route
[Python] I want to use the -h option with argparse
I want to judge the authenticity of the elements of numpy array
I want to know the features of Python and pip
Keras I want to get the output of any layer !!
I want to know the legend of the IT technology world
I want to use Linux commands at the command prompt! Use Linux commands at the command prompt instead of Git Bash
I want to manually assign the training parameters of the [Pytorch] model
I want to read the html version of "OpenCV-Python Tutorials" OpenCV 3.1 version
I want to output the beginning of the next month with Python
Comparison of GCP computing services [I want to use it serverless]
I want to use both key and value of Python iterator
I want to check the position of my face with OpenCV!
I want to know the population of each country in the world.
I want to pin Spyder to the taskbar
I want to output to the console coolly
I want to handle the rhyme part1
I want to handle the rhyme part3
I want to use jar from python
I want to use Linux on mac
I want to use IPython Qt Console
I want to display the progress bar
I want to handle the rhyme part2
I want to handle the rhyme part5
I want to handle the rhyme part4
[Note] I want to completely preprocess the data of the Titanic issue-Age version-
I want to send a signal only from the sub thread to the main thread
I don't want to admit it ... The dynamical representation of Neural Networks
(Python Selenium) I want to check the settings of the download destination of WebDriver
I want to batch convert the result of "string" .split () in Python
I want to explain the abstract class (ABCmeta) of Python in detail.
I want to sort a list in the order of other lists
I want to use the Django Debug Toolbar in my Ajax application
I want to express my feelings with the lyrics of Mr. Children
I want to analyze the emotions of people who want to meet and tremble
I want to leave an arbitrary command in the command history of Shell
I want to stop the automatic deletion of the tmp area with RHEL7
Python: I want to measure the processing time of a function neatly
I want to use MATLAB feval with python
I want to handle the rhyme part7 (BOW)
I want to revive the legendary Nintendo combination by making full use of AI and HR Tech!
I tried to touch the API of ebay
I tried to correct the keystone of the image
I want to use Temporary Directory with Python2
I want to get League of Legends data ③
I want to use complicated four arithmetic operations in the IF statement of the Django template! → Use a custom template
I want to get League of Legends data ②
I want to use ceres solver from python
I don't want to use -inf with np.log
I want to use ip vrf with SONiC