Welcome Guest

Pages: 1 2
Re-encoding of tags
x856450PostJune 11, 2021, 10:23
Newbie
Posts: 6
Registered:
June 11, 2021, 13:55
Normal topicRe-encoding of tags

Hi There,

First at all, thanks a lot for the powerful tool.

Is there any possibility to run an own script for re-encoding the text?

What I am trying to do is converting the DSF tags from traditional Chinese to simplified Chinese (both in UTF8). I am using cconv (https://github.com/xiaoyjy/cconv) to convert any text file or passing any converted strings to other command tools like metaflac:

$ cat file.txt | cconv -f UTF8-HK -t UTF8-CN
$ cconv -f UTF8-HK -t UTF8-CN -o output.txt file.txt

$ metaflac --export-tags-to=- file.flac |cconv -f UTF8-HK -t UTF8-CN | metaflac --remove-all-tags --import-tags-from=- file.flac

The above works fine. I found the definition for “new action” in Yate (Action Groups -> Text -> Re-encode) but there is no possibility to convert traditional Chinese to simplified Chinese. How can I perform the convertion similar as the above commands with cconv using Yate's action?

Best regards
Le

2MR2PostJune 11, 2021, 13:27
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe-encoding of tags

You could use Yate to call out to cconv to convert any text. I would have no way to test it myself but if you wish I can write you an action to pass text to cconv and accumulate the results. The action could then be called in another to convert specific text.

If you have a compiled version of cconv that you can zip up and send me, I'll have a look.

x856450PostJune 11, 2021, 15:22
Newbie
Posts: 6
Registered:
June 11, 2021, 13:55
Normal topicRe-encoding of tags

That sounds excellent.

Sure, I can send you the compiled version which I retreived via "brew install cconv". Please let me know how to send you, by email or upload somewehre?

Best
Le

2MR2PostJune 11, 2021, 15:24
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe-encoding of tags

Please email it (zipped) to support@2manyrobots.com

x856450PostJune 11, 2021, 15:39
Newbie
Posts: 6
Registered:
June 11, 2021, 13:55
Normal topicRe-encoding of tags

Just sent the email to you. Have to use another email account since Gmail does not allow me to send zipped file...

2MR2PostJune 11, 2021, 16:30
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe-encoding of tags

Okay I'll look at it over the next few days. I'll get back to you.

2MR2PostJune 11, 2021, 16:41
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe-encoding of tags

I just had a quick look and it seems to be easy. We can use the Export function in Yate to produce a plist of all tags. I'll then run that file through cconv and then re-import the tags from the output file.

I'm basing this entirely on the following sample on GitHub using you're settings:

echo "美发现号航天飞机, 上头发奖金;头发应该剪了,后天,皇后" | cconv -f utf-8 -t utf8-tw
美發現號航天飛機, 上頭發獎金;頭髮應該剪了,後天,皇后

I'll create the action and post it.

x856450PostJune 11, 2021, 18:25
Newbie
Posts: 6
Registered:
June 11, 2021, 13:55
Normal topicRe-encoding of tags

Does the action call the export function, convert the file using cconv and then import the converted file? That would be great!

2MR2PostJune 11, 2021, 19:02
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe-encoding of tags

That's what I'm hoping for. Can you please post two snippets I can paste into a comment field. One for the UTF8-H data and one for the UTF8-CN result.

x856450PostJune 11, 2021, 19:14
Newbie
Posts: 6
Registered:
June 11, 2021, 13:55
Normal topicRe-encoding of tags

Sure:

UTF8-HK: 幾多個幾多
UTF8-CN: 几多个几多

Pages: 1 2
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.02 seconds.