タグ

Stringに関するzepbagのブックマーク (2)

  • Natural Language Processing with Swift

    About the content This content has been published here with the express permission of the author. Apple has offered an API for natural language processing since iOS 5, which allowed us to tokenize text, detect the language, and determine parts of speech. With Swift and the introduction of Playgrounds, it’s faster and more delightful than ever to experiment with linguistics. We welcomed Ayaka Nonak

    Natural Language Processing with Swift
  • python2.xでの日本語(マルチバイト文字)問題を一掃する!(その1) — ExSoft

    python2.xを使い始めて、必ずと言って良いほど遭遇するのが日語(マルチバイト)関連の問題です。 ネットで同様のケースを調べて、あまり理解をせずに、対処療法的にその場の問題を回避している人も多いように思いますが、一度腰を据えて理解すれば、それほど難しくないですし、python以外の言語にも応用ができます。 マルチバイト問題については、概念だけではなく、実際に手を動かし、目で確かめる(文字コードそのものを見る)事が重要です。 今回は、python2.xで遭遇する文字コード関連のエラーを実際に発生させ、その理由を理解した上で対処を行ってみましょう。 文字コードの定義 ケース1 [ 再現 ] pythonスクリプトファイルのencodingをcp932にし、以下を記述します。 ustr = u'い' [ 現象 ] SyntaxError: Non-ASCII character '\x8

  • 1