Python论坛  - 讨论区

标题:[python-chinese] split words

2006年08月08日 星期二 10:14

huangrui rui.huang at samsung.com
Tue Aug 8 10:14:15 HKT 2006

An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060808/57ebc83f/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年08月08日 星期二 12:23

ainulinde ainulinde at gmail.com
Tue Aug 8 12:23:42 HKT 2006

汉语就没有这么容易的办法吧。

On 8/8/06, huangrui <rui.huang at samsung.com> wrote:
>
>
>
> >>> a=''''I like python!
>
> My Blog: http://www.donews.net/limodou
> My Django Site: http://www.djangocn.org
> NewEdit Maillist: http://groups.google.com/group/NewEdit
> '''
>
> >>> re.sub(r'[^a-z,^A-Z]',' ',a).split()
>
> ['I', 'like', 'python', 'My', 'Blog', 'http', 'www', 'donews', 'net',
> 'limodou',
>
>
>  'My', 'Django', 'Site', 'http', 'www', 'djangocn', 'org', 'NewEdit',
> 'Maillist'
>
>
> , 'http', 'groups', 'google', 'com', 'group', 'NewEdit']
>
>
>
>
>
>
> ------- Original Message -------
> Sender : limodou<limodou at gmail.com>
> Date : 八月 08, 2006 10:07
> Title : Re: [python-chinese] split words
>
> On 8/8/06, cry <zyqmail at tom.com> wrote:
> > python,您好!
> >
> > 请问怎么才可以把一个英文文本文件里的英文单词都分离出来,形成一个单词文件,每个单词一行,按字母次序。
> > 或者已经有这样的工具?知道的能否介绍一下?最好是PYTHON的。
> >
> > PYTHON里,把一行中的词分离,用什么方法比较好。split好象不能同时分离多种分割符。
> >
>  >>> a = 'a b\tc\nd'
>  >>> a.split()
>  ['a', 'b', 'c', 'd']
>
> --
> I like python!
> My Blog: http://www.donews.net/limodou
> My Django Site: http://www.djangocn.org
> NewEdit Maillist: http://groups.google.com/group/NewEdit
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to
> python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to
> python-chinese-request at lists.python.cn
> Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
>
>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年08月10日 星期四 09:31

Xiao Lei Wu xiaoleiw at cn.ibm.com
Thu Aug 10 09:31:00 HKT 2006

ººÓï·Ö´Ê£¬ºÇºÇ£¬µÃÒÀ¿¿·Ç³£ÅÓ´óµÄ×Öµä×÷ºó¶Ü

Best Regards,

Zachary Wu (Îâ°~ÀÚ)
Software Engineer, Enterprise Content Management FVT, IBM China Software
Development Lab
Tel: +86 10 82782244-3235. Fax: 82782244-2886 Tie Line: 915-2244-3235
Internet: xiaoleiw at cn.ibm.com
Notes ID: Xiao Lei Wu/China/Contr/IBM at IBMCN
Address: 8/F, Block A, Power Creative Building, No.1, East Road, Shang Di,
Beijing 100085, P.R. China

python-chinese-bounces at lists.python.cn дÓÚ 2006-08-08 12:23:42:

> ººÓï¾ÍûÓÐÕâôÈÝÒ׵İ취°É¡£
>
> On 8/8/06, huangrui <rui.huang at samsung.com> wrote:
> >
> >
> >
> > >>> a=''''I like python!
> >
> > My Blog: http://www.donews.net/limodou
> > My Django Site: http://www.djangocn.org
> > NewEdit Maillist: http://groups.google.com/group/NewEdit
> > '''
> >
> > >>> re.sub(r'[^a-z,^A-Z]',' ',a).split()
> >
> > ['I', 'like', 'python', 'My', 'Blog', 'http', 'www', 'donews', 'net',
> > 'limodou',
> >
> >
> >  'My', 'Django', 'Site', 'http', 'www', 'djangocn', 'org', 'NewEdit',
> > 'Maillist'
> >
> >
> > , 'http', 'groups', 'google', 'com', 'group', 'NewEdit']
> >
> >
> >
> >
> >
> >
> > ------- Original Message -------
> > Sender : limodou<limodou at gmail.com>
> > Date : °ËÔÂ 08, 2006 10:07
> > Title : Re: [python-chinese] split words
> >
> > On 8/8/06, cry <zyqmail at tom.com> wrote:
> > > python£¬ÄúºÃ£¡
> > >
> > > ÇëÎÊÔõô²Å¿ÉÒÔ°ÑÒ»¸öÓ¢ÎÄÎı¾ÎļþÀïµÄÓ¢Îĵ¥´Ê¶¼·ÖÀë³öÀ´£¬ÐγÉÒ»¸ö
> µ¥´ÊÎļþ£¬Ã¿¸öµ¥´ÊÒ»ÐУ¬°´×Öĸ´ÎÐò¡£
> > > »òÕßÒѾ­ÓÐÕâÑùµÄ¹¤¾ß£¿ÖªµÀµÄÄÜ·ñ½éÉÜһϣ¿×îºÃÊÇPYTHONµÄ¡£
> > >
> > > PYTHONÀ°ÑÒ»ÐÐÖеĴʷÖÀ룬ÓÃʲô·½·¨±È½ÏºÃ¡£splitºÃÏó²»ÄÜͬʱ·Ö
> Àë¶àÖÖ·Ö¸î·û¡£
> > >
> >  >>> a = 'a b\tc\nd'
> >  >>> a.split()
> >  ['a', 'b', 'c', 'd']
> >
> > --
> > I like python!
> > My Blog: http://www.donews.net/limodou
> > My Django Site: http://www.djangocn.org
> > NewEdit Maillist: http://groups.google.com/group/NewEdit
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to
> > python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request at lists.python.cn
> > Detail Info:
> > http://python.cn/mailman/listinfo/python-chinese
> >
> >
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060810/eace0fc6/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年08月10日 星期四 13:43

R.Potato rough.vanzolo at gmail.com
Thu Aug 10 13:43:02 HKT 2006

û´í£¬ËäÈ»¶þ·ÖÇдÊÔÚIRÀïÃæÓÐÓõ½£¬µ«ÊǶÔÓÚÐèÒªÓÐÒâÒåµÄ½á¹ûµÄ³¡ºÏ£¬»¹ÊÇÐèÒªÓдʵäÀ´Ö§³Ö¡£
¶øÇÒ¼´Ê¹ÓдʵäÒ²ÐèÒª±È½Ï¸´ÔÓµÄËã·¨À´×ö´¦Àí²ÅÄܵõ½±È½Ï²»´íµÄ½á¹û¡£Ã»ÓÐʲôͨÓõÄËã·¨Äܹ»´ïµ½100%µÄÇзÖÕýÈ·¡£


On 8/10/06, Xiao Lei Wu <xiaoleiw at cn.ibm.com> wrote:
>
>  ººÓï·Ö´Ê£¬ºÇºÇ£¬µÃÒÀ¿¿·Ç³£ÅÓ´óµÄ×Öµä×÷ºó¶Ü
>
> Best Regards,
>
> Zachary Wu (Îâ°~ÀÚ)
> Software Engineer, Enterprise Content Management FVT, IBM China Software
> Development Lab
> Tel: +86 10 82782244-3235. Fax: 82782244-2886 Tie Line: 915-2244-3235
> Internet: xiaoleiw at cn.ibm.com
> Notes ID: Xiao Lei Wu/China/Contr/IBM at IBMCN
> Address: 8/F, Block A, Power Creative Building, No.1, East Road, Shang Di,
> Beijing 100085, P.R. China
>
> python-chinese-bounces at lists.python.cn дÓÚ 2006-08-08 12:23:42:
>
> > ººÓï¾ÍûÓÐÕâôÈÝÒ׵İ취°É¡£
> >
> > On 8/8/06, huangrui <rui.huang at samsung.com> wrote:
> > >
> > >
> > >
> > > >>> a=''''I like python!
> > >
> > > My Blog: http://www.donews.net/limodou
> > > My Django Site: http://www.djangocn.org
> > > NewEdit Maillist: http://groups.google.com/group/NewEdit
> > > '''
> > >
> > > >>> re.sub(r'[^a-z,^A-Z]',' ',a).split()
> > >
> > > ['I', 'like', 'python', 'My', 'Blog', 'http', 'www', 'donews', 'net',
> > > 'limodou',
> > >
> > >
> > >  'My', 'Django', 'Site', 'http', 'www', 'djangocn', 'org', 'NewEdit',
> > > 'Maillist'
> > >
> > >
> > > , 'http', 'groups', 'google', 'com', 'group', 'NewEdit']
> > >
> > >
> > >
> > >
> > >
> > >
> > > ------- Original Message -------
> > > Sender : limodou<limodou at gmail.com>
> > > Date : °ËÔÂ 08, 2006 10:07
> > > Title : Re: [python-chinese] split words
> > >
> > > On 8/8/06, cry <zyqmail at tom.com> wrote:
> > > > python£¬ÄúºÃ£¡
> > > >
> > > > ÇëÎÊÔõô²Å¿ÉÒÔ°ÑÒ»¸öÓ¢ÎÄÎı¾ÎļþÀïµÄÓ¢Îĵ¥´Ê¶¼·ÖÀë³öÀ´£¬ÐγÉÒ»¸ö
> > µ¥´ÊÎļþ£¬Ã¿¸öµ¥´ÊÒ»ÐУ¬°´×Öĸ´ÎÐò¡£
> > > > »òÕßÒѾ­ÓÐÕâÑùµÄ¹¤¾ß£¿ÖªµÀµÄÄÜ·ñ½éÉÜһϣ¿×îºÃÊÇPYTHONµÄ¡£
> > > >
> > > > PYTHONÀ°ÑÒ»ÐÐÖеĴʷÖÀ룬ÓÃʲô·½·¨±È½ÏºÃ¡£splitºÃÏó²»ÄÜͬʱ·Ö
> > Àë¶àÖÖ·Ö¸î·û¡£
> > > >
> > >  >>> a = 'a b\tc\nd'
> > >  >>> a.split()
> > >  ['a', 'b', 'c', 'd']
> > >
> > > --
> > > I like python!
> > > My Blog: http://www.donews.net/limodou
> > > My Django Site: http://www.djangocn.org
> > > NewEdit Maillist: http://groups.google.com/group/NewEdit
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese at lists.python.cn
> > > Subscribe: send subscribe to
> > > python-chinese-request at lists.python.cn
> > > Unsubscribe: send unsubscribe to
> > > python-chinese-request at lists.python.cn
> > > Detail Info:
> > > http://python.cn/mailman/listinfo/python-chinese
> > >
> > >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>


-- 
Thanks&&Regards;,
Li Hongliang

Юһ¾íÊé
¹ÛÌì²âµØ
ÕÌÒ»¿Ú½£
±£¼ÒÎÀ¹ú
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060810/d0cba174/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年08月10日 星期四 14:31

ainulinde ainulinde at gmail.com
Thu Aug 10 14:31:28 HKT 2006

tMq15MrH0ru49s7KzOKjrLWryse6w8/xo6zOyszisru99r321Nq0yrXk0ru49re9w+bByy4KCk9u
IDgvMTAvMDYsIFhpYW8gTGVpIFd1IDx4aWFvbGVpd0Bjbi5pYm0uY29tPiB3cm90ZToKPgo+Cj4K
PiC6utPvt9a0yqOsuse6x6OstcPSwL+/t8ezo8XTtPO1xNfWteTX97rzttwKPgo+ICBCZXN0IFJl
Z2FyZHMsCj4KPiAgWmFjaGFyeSBXdSAozuKwfsDaKQo+ICBTb2Z0d2FyZSBFbmdpbmVlciwgRW50
ZXJwcmlzZSBDb250ZW50IE1hbmFnZW1lbnQgRlZULCBJQk0gQ2hpbmEgU29mdHdhcmUKPiBEZXZl
bG9wbWVudCBMYWIKPiAgVGVsOiArODYgMTAgODI3ODIyNDQtMzIzNS4gRmF4OiA4Mjc4MjI0NC0y
ODg2IFRpZSBMaW5lOiA5MTUtMjI0NC0zMjM1Cj4gIEludGVybmV0OiB4aWFvbGVpd0Bjbi5pYm0u
Y29tCj4gIE5vdGVzIElEOiBYaWFvIExlaSBXdS9DaGluYS9Db250ci9JQk1ASUJNQ04KPiAgQWRk
cmVzczogOC9GLCBCbG9jay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nB5dGhvbi5jbgo+ICA+IFVuc3Vic2NyaWJlOiBzZW5kIHVuc3Vic2NyaWJlIHRvCj4gcHl0aG9u
LWNoaW5lc2UtcmVxdWVzdEBsaXN0cy5weXRob24uY24KPiAgPiBEZXRhaWwgSW5mbzoKPiBodHRw
Oi8vcHl0aG9uLmNuL21haWxtYW4vbGlzdGluZm8vcHl0aG9uLWNoaW5lc2UKPgo+Cj4KPiBfX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwo+IHB5dGhvbi1jaGlu
ZXNlCj4gUG9zdDogc2VuZCBweXRob24tY2hpbmVzZUBsaXN0cy5weXRob24uY24KPiBTdWJzY3Jp
YmU6IHNlbmQgc3Vic2NyaWJlIHRvCj4gcHl0aG9uLWNoaW5lc2UtcmVxdWVzdEBsaXN0cy5weXRo
b24uY24KPiBVbnN1YnNjcmliZTogc2VuZCB1bnN1YnNjcmliZSB0bwo+IHB5dGhvbi1jaGluZXNl
LXJlcXVlc3RAbGlzdHMucHl0aG9uLmNuCj4gRGV0YWlsIEluZm86Cj4gaHR0cDovL3B5dGhvbi5j
bi9tYWlsbWFuL2xpc3RpbmZvL3B5dGhvbi1jaGluZXNlCj4KPgo=

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号