自然语言处理python进阶(二)
生活随笔
收集整理的这篇文章主要介绍了
自然语言处理python进阶(二)
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
python字符串的简单使用
namesList = ['Tuffy','Ali','Nysha','Tim' ] sentence = 'My dog sleeps on sofa'names = ';'.join(namesList) print(type(names), ':', names) wordList = sentence.split(' ') print((type(wordList)), ':', wordList) additionExample = 'ganehsa' + 'ganesha' + 'ganesha' multiplicationExample = 'ganesha' * 2 print('Text Additions :', additionExample) print('Text Multiplication :', multiplicationExample) str = 'Python NLTK' print(str[1]) print(str[-3])使用python读取pdf
from PyPDF2 import PdfFileReaderdef getTextPDF(pdfFileName, password = ''):# 打开pdf_file = open(pdfFileName, 'rb')# 读取read_pdf = PdfFileReader(pdf_file)if password != '':read_pdf.decryp总结
以上是生活随笔为你收集整理的自然语言处理python进阶(二)的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 亚马逊美国站陶瓷加热灯UL482测试标准
- 下一篇: 二十四、深入Python多线程和多进程