{ "info": { "author": "Junnosuke Moriya", "author_email": "shinsen.jikyo@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: Japanese", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries" ], "description": "====\nsuji\n====\n\nsuji is a converter library from Japanese number notation to numerical value, and from numerical notation to Japanese Kansuji notation.\n\n\nTo convert from Japanese number notation to numerical string or value:\n----------------------------------------------------------------------\n\nJapanese number notation can include Kansuji.\nThe string `\uff11\u3064\u306e\u4fa1\u683c\u304c\u4e8c\u514630\u4e07\u4e94\u5343\u53417\u5186\u306b\u306a\u308a\u307e\u3059\u3002` will be converted to two integers, `1` and `2000000005017`.\nAnd also, `\u6253\u7387\u306f\u4e09\u5272\u4e8c\u90e8\u4e94\u5398\u3067\u3059\u3002` will be a float `0.325`.\n\n\n**value:**\n\nThe return value is a converted str.\nIf the input string has no number notation, `value` returns the input str.\n\n\n**values:**\n\nThe return value is a list of result objects.\nIf the input string has no number notation, suji returns a empty list.\nThe result object has three keys: `val`, `beg`, and `end`:\n\n:val: the numerical value of the number notation.\n:beg: the start postion of the found number notation at the input string.\n:end: the end postion of the found number notation.\n\n\nTo convert from numeric notation to Japanese Kanji notation:\n------------------------------------------------------------\n\nThe string `\u4e8c\u514630\u4e07\u4e94\u5343\u53417\u5186\u306b\u306a\u308a\u307e\u3059\u3002` will be converted to the Kansuji string, `\u4e8c\u5146\u4e09\u5341\u4e07\u4e94\u5343\u5341\u4e03`.\nThe boolean flag `one` is interpreted as whether to display the first character `\u4e00` or not.\nThe output of `suji.kansuji('1000\u4e07')` will be converted to `\u4e00\u5343\u4e07` (as default),\nand the output of `suji.kansuji('1000\u4e07', False)` will be converted to `\u5343\u4e07`.\nNote that suji does *not* support numerical notation after the decimal point.\nIf the inpust string is `32.01`, the output will `\u4e09\u5341\u4e8c`, not `\u4e09\u5341\u4e8c\u5272\u4e00\u5398`.\n\n\n**kansuji:**\n\nThe retun value is a covnerted str.\nIf the input string has no number notation, `kansuji` returns the input str.\n\n\n**kansujis:**\n\nThe return value is a list of result objects.\nIf the input string has no number notation, `kansujis` returns a empty list.\nThe result object has three keys: `val`, `beg`, and `end`:\n\n:val: the Kansuji notation string\n:beg: the start postion of the found number notation at the input string.\n:end: the end postion of the found number notation.\n\n\nsuji is a one-pass parser.\nThat is, suji parse a source text from the head to the end only once.\nThis library is pure Python code with no dependencies.\n\n\nInstallation:\n-------------\n\n $ pip install suji\n\n\nUsage:\n------\n\n.. code-block:: python\n\n >>> import suji\n\n >>> suji.value('\uff11\u3064\u306e\u4fa1\u683c\u304c\u4e8c\u514630\u4e07\u4e94\u5343\u53417\u5186\u306b\u306a\u308a\u307e\u3059\u3002')\n 1\u3064\u306e\u4fa1\u683c\u304c2000000305017\u5186\u306b\u306a\u308a\u307e\u3059\u3002\n >>> suji.value('\u4e00\u5343\u4e07\u3067\u3059\u3002')\n 10000000\u3067\u3059\u3002\n >>> suji.value('\u3053\u3093\u306b\u3061\u306f')\n \u3053\u3093\u306b\u3061\u306f\n\n >>> suji.values('\uff11\u3064\u306e\u4fa1\u683c\u304c\u4e8c\u514630\u4e07\u4e94\u5343\u53417\u5186\u306b\u306a\u308a\u307e\u3059\u3002')\n [{'val': 1, 'beg': 0, 'end': 1}, {'val': 2000000305017, 'beg': 6, 'end': 15}]\n >>> suji.values('\u6253\u7387\u306f\u4e09\u5272\u4e8c\u5206\u4e94\u5398\u3067\u3059\u3002')\n [{'val': 0.32500000000000007, 'beg': 3, 'end': 9}]\n >>> suji.values('\u3053\u3093\u306b\u3061\u306f')\n []\n\n >>> suji.kansuji('\u4fa1\u683c\u306f\uffe510,000,056\u3067\u3059\u3002')\n \u4fa1\u683c\u306f\uffe5\u4e00\u5343\u4e07\u4e94\u5341\u516d\u3067\u3059\n >>> suji.kansuji('\u4fa1\u683c\u306f\uffe510,000,056\u3067\u3059\u3002', False)\n \u4fa1\u683c\u306f\uffe5\u5343\u4e07\u4e94\u5341\u516d\u3067\u3059\n >>> suji.kansuji('\u3053\u3093\u306b\u3061\u306f')\n \u3053\u3093\u306b\u3061\u306f\n\n >>> suji.kansujis('\u4fa1\u683c\u306f\uffe510,000,056\u3067\u3059\u3002')\n [{'val': '\u4e00\u5343\u4e07\u4e94\u5341\u516d', 'beg': 4, 'end': 14}]\n >>> suji.kansujis('\u4fa1\u683c\u306f\uffe510,000,056\u3067\u3059\u3002', False)\n [{'val': '\u5343\u4e07\u4e94\u5341\u516d', 'beg': 4, 'end': 14}]\n >>> suji.kansujis('\u3053\u3093\u306b\u3061\u306f')\n []\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jikyo/suji4p", "keywords": "", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "suji", "package_url": "https://pypi.org/project/suji/", "platform": "", "project_url": "https://pypi.org/project/suji/", "project_urls": { "Homepage": "https://github.com/jikyo/suji4p" }, "release_url": "https://pypi.org/project/suji/0.0.6/", "requires_dist": null, "requires_python": "", "summary": "Japanese number notation converter", "version": "0.0.6" }, "last_serial": 5577578, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "44bff491073cb0fc269fdcb2ce09c87b", "sha256": "c2f5c5e9980b1f4447b7880a1e6dbdd0b105c64514dd9a55dd88a96c88bc840f" }, "downloads": -1, "filename": "suji-0.0.3.tar.gz", "has_sig": false, "md5_digest": "44bff491073cb0fc269fdcb2ce09c87b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4185, "upload_time": "2019-01-05T09:46:37", "url": "https://files.pythonhosted.org/packages/f2/1e/9df01e1c68645cefe817b1b85fd6af3c071e8b637b35199e92741f8deeb6/suji-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "197e2fb144e288f5d4da1f080146a671", "sha256": "7191b28478fdbf18e48a01eb571cf8d4e6f7b441d099c902c7a260e07bd993c0" }, "downloads": -1, "filename": "suji-0.0.4.tar.gz", "has_sig": false, "md5_digest": "197e2fb144e288f5d4da1f080146a671", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4136, "upload_time": "2019-01-05T10:17:16", "url": "https://files.pythonhosted.org/packages/d3/6e/dbe301ccbb04d06e6f27b2bcc6a5995a55ff480b295969671ad4850d4aea/suji-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "7b8eefc8a31e48cdd56731dab423ac73", "sha256": "430dd4f9db62b30c760d080813cdd3a59ab1038547f3f4daaf0af2bf81c79b36" }, "downloads": -1, "filename": "suji-0.0.5.tar.gz", "has_sig": false, "md5_digest": "7b8eefc8a31e48cdd56731dab423ac73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5477, "upload_time": "2019-07-15T09:31:27", "url": "https://files.pythonhosted.org/packages/57/d9/59fd5f4039fa353964f50edc92cf45cf0012bf57f8bd42b3954d2d1d919b/suji-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "b1525c7b1322e7e70242fb2de554d220", "sha256": "c682652401bcca2ac8c7ea1832d44b3de0d4e1e698ed3c3f3a0d914c4dc39bd2" }, "downloads": -1, "filename": "suji-0.0.6.tar.gz", "has_sig": false, "md5_digest": "b1525c7b1322e7e70242fb2de554d220", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6378, "upload_time": "2019-07-24T13:19:56", "url": "https://files.pythonhosted.org/packages/67/c6/5cac0c1373989c8ce545b542060127356cf137ded8a003bfb6a49fa84a73/suji-0.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b1525c7b1322e7e70242fb2de554d220", "sha256": "c682652401bcca2ac8c7ea1832d44b3de0d4e1e698ed3c3f3a0d914c4dc39bd2" }, "downloads": -1, "filename": "suji-0.0.6.tar.gz", "has_sig": false, "md5_digest": "b1525c7b1322e7e70242fb2de554d220", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6378, "upload_time": "2019-07-24T13:19:56", "url": "https://files.pythonhosted.org/packages/67/c6/5cac0c1373989c8ce545b542060127356cf137ded8a003bfb6a49fa84a73/suji-0.0.6.tar.gz" } ] }