Github user witgo commented on the pull request:

    https://github.com/apache/spark/pull/1983#issuecomment-55095890
  
    @allwefantasy 
    我认为这里的代码`  Document(parts(0).toInt,(0 until 
wordInfo.value.size).map(k=> values.getOrElse(k,0)).toArray)` 
是有点问题的.. 
    应该是这样处理的. 每个词对应一个整数,  例如 a => 1, 
b=>2, c=> 3, d=> 4 ...  z => 27
    如果你的文档切词的序列是 a, b,d,a 这三个词  
Document实例是这么创建的.`Document(1,Array(1,2,4,1))`.
    Document conten 本质上是文档词的分词产生的结果.   只是把 
a,b,d,a 这样的字符串数组用整数数组表示.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to