我从此页面下载ClueWeb09_English_Sample.warc文件,然后使用以下网页的给定代码在文本文件中写入warc文件的数据.我想解析文本文件以实现文本文件中页面的内容,但我不知道应该如何解析它.有没有办法解析warc文件而不将其转换为文本?
我想解析以下文本:
WARC/0.18
WARC-Type: warcinfo
WARC-Date: 2009-04-119T12:48:17-0400
WARC-Record-ID: d4360e52-06c3-41c8-bb13-62db3a622ca7
Content-Type: application/warc-fields
Content-Length: 218
software: Nutch 1.0-dev (modified for clueweb09)
isPartOf: clueweb09-
description: clueweb09 crawl with WARC output
format: WARC file version 0.18
conformsTo: http://www.archive.org/documents/WarcFileFormat-0.18.html
WARC/0.18
WARC-Type: response
WARC-Date: 2009-03-67T15:35:34-0700
WARC-Identified-Payload-Type:
WARC-TREC-ID: clueweb09-en0040-54-00000
WARC-Target-URI: http://www.smartwebby.com/DreamweaverTemplates/templates/business_general_template59.asp
WARC-Warcinfo-ID: d4360e52-06c3-41c8-bb13-62db3a622ca7
WARC-Record-ID: <urn:uuid:721f9a28-6b9a-44c1-bccd-8c7accb514cd>
Content-Type: application/http;msgtype=response
Content-Length: 21064
HTTP/1.1 200 OK
Content-Type: text/html
X-Powered-By: ASP.NET
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
Cache-control: private
Date: Fri, 30 Jan 2009 18:08:20 GMT
Connection: close
Set-Cookie: COOtempname=; …Run Code Online (Sandbox Code Playgroud) 我希望反向绘制地图,这意味着我有很多键,只有一个值.我需要这个结构,所以当我搜索其中一个键时,我得到了值.
我可以使用简单的哈希映射,但由于多次存储值,它会浪费空间.我正在寻找java中的优化和高效实现.我很感激你的建议.