编写一个程序，在给定的数据集上训练文本分类器，并使用其对新文本进行分类。
以下是一个示例数据集，其中包含电子邮件文本和与之相关的标签。
```
data = [
        ("Hey there! I am looking for a new laptop, any recommendations?", "laptop"),
        ("What's the best phone under 500 dollars?", "phone"),
        ("I am having trouble with my computer, can you help?", "computer"),
        ("The battery life on my phone is terrible, any suggestions?", "phone"),
        ("Do you prefer Mac or PC for programming?", "computer")
       ]
```
您可以使用自然语言处理工具包（如NLTK或SpaCy）和机器学习算法（如朴素贝叶斯或支持向量机）来训练文本分类器。以下是一些示例代码：

```python
import nltk
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords

stop_words = set(stopwords.words('english'))

def preprocess_text(text):
    # 将文本转换为小写，并分词
    words = word_tokenize(text.lower())

    # 去除停用词
    filtered_words = [word for word in words if word not in stop_words]

    # 将每个词转换为词根
    stemmer = nltk.PorterStemmer()
    stemmed_words = [stemmer.stem(word) for word in filtered_words]

    # 将文本重构为处理过的字符串
    return " ".join(stemmed_words)

# 预处理并将数据拆分为特征集和标签集
X = [preprocess_text(text) for text, label in data]
y = [label for text, label in data]

# 将特征集转换为词频向量
from sklearn.feature_extraction.text import CountVectorizer

vectorizer = CountVectorizer()
X_counts = vectorizer.fit_transform(X)

# 划分数据集为训练集和测试集
from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = train_test_split(X_counts, y, test_size=0.2)

# 训练模型
from sklearn.naive_bayes import MultinomialNB

clf = MultinomialNB()
clf.fit(X_train, y_train)

# 对新数据进行分类
new_text = "I need a new phone, any suggestions?"
preprocessed_text = preprocess_text(new_text)
X_new = vectorizer.transform([preprocessed_text])
predicted_label = clf.predict(X_new)

print(predicted_label)
```

输出为`['phone']`，表示该新文本属于“phone”类别。