小编Dak*_*iya的帖子

创建具有多个对象类型的ArrayList?

如何创建ArrayList带整数和字符串输入类型?如果我创建一个:

List<Integer> sections = new ArrayList <Integer>();
Run Code Online (Sandbox Code Playgroud)

这将是一种Integer类型ArrayList.如果我创建一个:

List<String> sections = new ArrayList <String>();
Run Code Online (Sandbox Code Playgroud)

这将是String类型.如何创建一个ArrayList可以采用整数和字符串输入类型的?谢谢.

java arraylist

42
推荐指数
6
解决办法
25万
查看次数

LookupError:从 nltk.book 导入*

在 iPython 控制台中,我from nltk.book import输入了几个 LookupErrors。下面显示了我得到的代码。

*** Introductory Examples for the NLTK Book ***
Loading text1, ..., text9 and sent1, ..., sent9
Type the name of the text or sentence to view it.
Type: 'texts()' or 'sents()' to list the materials.
---------------------------------------------------------------------------
LookupError Traceback (most recent call last)
<ipython-input-3-8446809acbd4> in <module>()
 ----> 1 from nltk.book import*

C:\Users\dell\Anaconda\lib\site-packages\nltk-3.0.3-py2.7.egg\nltk\book.py in <module>()
 20 print("Type: 'texts()' or 'sents()' to list the materials.")
 21 
---> 22 text1 = Text(gutenberg.words('melville-moby_dick.txt'))
 23 print("text1:", text1.name)
 24 …
Run Code Online (Sandbox Code Playgroud)

python import ipython nltk anaconda

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

anaconda ×1

arraylist ×1

import ×1

ipython ×1

java ×1

nltk ×1

python ×1