|
2009-04-02
, 08:42
|
Posts: 13 |
Thanked: 4 times |
Joined on Feb 2008
@ Beijing, China
|
#2
|
|
2009-04-02
, 13:36
|
Posts: 66 |
Thanked: 11 times |
Joined on Feb 2009
|
#3
|
|
2009-04-02
, 13:59
|
Posts: 34 |
Thanked: 2 times |
Joined on Mar 2009
|
#4
|
|
2009-04-02
, 14:17
|
Posts: 66 |
Thanked: 11 times |
Joined on Feb 2009
|
#5
|
The Following User Says Thank You to ctennenh For This Useful Post: | ||
|
2009-04-02
, 14:57
|
Posts: 66 |
Thanked: 11 times |
Joined on Feb 2009
|
#6
|
|
2009-08-21
, 08:48
|
Posts: 1 |
Thanked: 0 times |
Joined on Aug 2009
|
#7
|
#!/bin/sh # Converts cedict to English -> Chinese babylon file # using cedict_1_0_ts_utf8_mdbg. Use stardict-tools # to convert $OUTFILE to stardict format. CEDICT_FILE=$1 OUTFILE=$2 COUNTER=35 ENDLINE=`cat $CEDICT_FILE | wc -l` touch $OUTFILE while [ $COUNTER -le $ENDLINE ] do WLINE=`sed -n ${COUNTER}p $CEDICT_FILE` echo $WLINE | sed 's/.* \///' | sed 's/\/.$//' | tr "/" "|" >> $OUTFILE echo $WLINE | awk -F / '{print $1 "\n"}' >> $OUTFILE ((COUNTER++)) done
|
2010-10-23
, 23:10
|
|
Posts: 122 |
Thanked: 22 times |
Joined on Jun 2010
@ China
|
#8
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX 300
int parser(char string[])
{
int c, i;
for (i=0; i < MAX && (c=getchar()) != EOF && c != '\n'; ++i)
string[i] = c;
if (c == '\n') {
string[i] = c;
++i;
}
string[i] = '\0';
return i;
}
int split(const char src[], char prt[], int del, int idx)
{
int i = 0, j = 0;
if (!idx) {
while ((prt[j++] = src[i++]) != '\0' && src[i] != '\n' && src[i] != del && i < MAX);
prt[i] = '\0';
}
else {
int n = 0;
while (src[i++] != '\0' && src[i] != '\n' && i < MAX) {
if (src[i] == del) {
if (++n == idx) {
i++;
while ((prt[j++]=src[i++]) != '\0' && src[i] != '\n' && src[i] != del && i < MAX);
prt[j] = '\0';
}
}
}
}
return j;
}
int get_range(const char *str, int del) {
int i=0, j = 0;
while (*str++ != '\0' && i++ < MAX) {
if (*str == del)
j++;
}
return j;
}
int main()
{
char prt[300], def[300], line[300];
int i, j, len, range;
while ((len = parser(line)) > 0) {
range = get_range(line, '/');
j = split(line, def, '/', 0);
for (i=1; i < range; i++) {
j = split(line, prt, '/', i);
printf("%s\t%s\n", prt, def);
}
}
return 0;
}
cc ce2ec.c cat cedict_ts.u8 | ./a.out > ecdict.tab sudo apt-get install stardict-tools /usr/lib/stardict-tools/tabfile ecdict.tab sudo mkdir /usr/share/stardict/dic/ecdict sudo mv ecdict.* /usr/share/stardict/dic/ecdict sudo -hr root:root /usr/share/stardict/dic/ecdict stardict echo 'Everything should be just ok xD';
|
2010-11-28
, 21:00
|
Posts: 3 |
Thanked: 3 times |
Joined on Nov 2010
@ Germany
|
#9
|
|
2010-12-20
, 06:09
|
Posts: 1 |
Thanked: 1 time |
Joined on Nov 2010
|
#10
|
The Following User Says Thank You to s331234 For This Useful Post: | ||
Tags |
chinese, dictionary, stardict, translate |
|
Also, any other software anyone could give me advice on would be great, even Windows/Tablet PC specific stuff.
Thanks.