input: Write a function to classify emails from the Enron Spam Dataset as either spam or non-spam using a bag of words model and a Support Vector Machine (SVM) classifier. The function should return the precision score of the model. If the dataset is empty, return 0.
output: 
  def classify_emails(dataset):
      if not dataset:
          return 0
      
      from sklearn.feature_extraction.text import CountVectorizer
      from sklearn.svm import SVC
      from sklearn.metrics import precision_score
      from sklearn.model_selection import train_test_split
      
      emails, labels = zip(*dataset)
      X_train, X_test, y_train, y_test = train_test_split(emails, labels, test_size=0.2, random_state=42)
      
      vectorizer = CountVectorizer()
      X_train_vec = vectorizer.fit_transform(X_train)
      X_test_vec = vectorizer.transform(X_test)
      
      svm = SVC(kernel='linear')
      svm.fit(X_train_vec, y_train)
      
      y_pred = svm.predict(X_test_vec)
      precision = precision_score(y_test, y_pred, average='binary')
      
      return precision
  