This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on 2017/5/25 | |
@author: itakura | |
"Unicode <-> str 変換関連" | |
""" | |
class strutils: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function MD5Hex(textString As String) As String | |
Dim enc | |
Dim textBytes() As Byte | |
Dim bytes | |
Dim outstr As String | |
Set enc = CreateObject("System.Security.Cryptography.MD5CryptoServiceProvider") | |
textBytes = textString | |
bytes = enc.ComputeHash_2((textBytes)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.io.Source | |
// Read CSV create and create Map | |
object DictSource2SeedDict extends App { | |
val csvFile = Source.fromFile("file_path", "utf8") | |
val listDict = Map(csvFile.getLines.toList.map{l => | |
val lc = l.split("\t") | |
(lc(0)->lc(1)) // assume first field is key and second field is value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function IsAllHiragana(cell) | |
Set REG = CreateObject("VBScript.RegExp") | |
REG.Pattern = "^[ぁ-んー]+$" ' there are a couple of more hiragana in unicode, which are ignored | |
Set REGMatch = REG.Execute(cell) | |
If REGMatch.Count > 0 Then | |
IsAllHiragana = True | |
Else | |
IsAllHiragana = False | |
End If | |
End Function |
NewerOlder