如何重新连接到 R tm 包中的 PCorpus?

编程入门 行业动态 更新时间:2024-10-25 20:28:50
本文介绍了如何重新连接到 R tm 包中的 PCorpus?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我创建了一个 PCorpus,据我所知它存储在 HDD 上,代码如下:

I create a PCorpus, which as far as I understand is stored on HDD, with the following code:

pc = PCorpus(vs, readerControl = list(language = "pl"), dbControl = list(dbName = "pcorpus", dbType = "DB1"))

我以后如何重新连接到该数据库?

How may I reconnect to that database later?

推荐答案

据我所知,你不能.数据库"实际上是一个文件哈希对象,您可以按如下方式重新连接和加载,

You can't as far as I'm aware. The 'database' is actually a filehash object, which you can reconnect to and load as follows,

db <- dbInit("pcorpus")
pc<-dbLoad(db)

但它加载每个文件作为它自己的对象.您需要使用 writeCorpus 显式保存到磁盘,并每次调用 PCorpus 重新加载.PCorpus 对象只是提供了一种将 Corpus 对象创建到磁盘而不是内存的方法.

but it loads each file as it's own object. You need to save to disk explicitly using writeCorpus and reload with a call to PCorpus each time. The PCorpus object just provides a way of creating a Corpus object to disk rather than memory.

这篇关于如何重新连接到 R tm 包中的 PCorpus?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 05:17:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1390139.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:连接到   包中   tm   PCorpus

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!