Skip to content

Commit

Permalink
Scala DF filter updates for a few aut PRs. (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruebot authored and ianmilligan1 committed Jan 13, 2020
1 parent 4186cd9 commit a59904a
Showing 1 changed file with 84 additions and 8 deletions.
92 changes: 84 additions & 8 deletions current/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,16 @@ r.keepHttpStatus(statusCodes)

### Scala DF

TODO
```scala
import io.archivesunleashed._
import io.archivesunleashed.df._

val statusCodes = Set("200")

RecordLoader.loadArchives("example.warc.gz",sc)
.all()
.keepHttpStatusDF(statusCodes)
```

### Python DF

Expand All @@ -127,7 +136,16 @@ r.keepDate(dates)

### Scala DF

TODO
```scala
import io.archivesunleashed._
import io.archivesunleashed.df._

val dates = List("04")

RecordLoader.loadArchives("example.warc.gz",sc)
.all()
.keepDateDF(dates)
```

### Python DF

Expand Down Expand Up @@ -193,7 +211,16 @@ r.keepDomains(domains)

### Scala DF

TODO
```scala
import io.archivesunleashed._
import io.archivesunleashed.df._

val urls = Set("http://www.archive.org/")

RecordLoader.loadArchives("example.warc.gz",sc)
.webpages()
.keepUrlsDF(urls)
```

### Python DF

Expand Down Expand Up @@ -237,7 +264,17 @@ r.keepContent(content)

### Scala DF

TODO
```scala
import io.archivesunleashed._
import io.archivesunleashed.df._

val content = Set("Content-Length: [0-9]{4}".r)

RecordLoader.loadArchives("example.warc.gz", sc)
.all()
.select("url", "content")
.keepContentDF(content)
```

### Python DF

Expand Down Expand Up @@ -310,7 +347,16 @@ r.discardHttpStatus(statusCodes)

### Scala DF

TODO
```scala
import io.archivesunleashed._
import io.archivesunleashed.df._

val statusCodes = Set("200")

RecordLoader.loadArchives("example.warc.gz",sc)
.all()
.discardHttpStatusDF(statusCodes)
```

### Python DF

Expand Down Expand Up @@ -390,7 +436,17 @@ r.discardUrlPatterns(urls)

### Scala DF

TODO
```scala
import io.archivesunleashed._
import io.archivesunleashed.df._

val urlPattern = Set(".*images.*".r)

RecordLoader.loadArchives("example.warc.gz",sc)
.all()
.select("url")
.discardUrlPatternsDF(urlPattern)
```

### Python DF

Expand Down Expand Up @@ -441,7 +497,17 @@ r.keepLanguages(languages)

### Scala DF

TODO
```scala
import io.archivesunleashed._
import io.archivesunleashed.df._

val languages = Set("th","de","ht")

RecordLoader.loadArchives("example.warc.gz",sc)
.all()
.select("url")
.discardLanguagesDF(languages)
```

### Python DF

Expand All @@ -463,7 +529,17 @@ r.discardContent(content)

### Scala DF

TODO
```scala
import io.archivesunleashed._
import io.archivesunleashed.df._

val content = Set("Content-Length: [0-9]{4}".r)

RecordLoader.loadArchives("example.warc.gz",sc)
.all()
.select("url", "content")
.discardContentDF(content)
```

### Python DF

Expand Down

0 comments on commit a59904a

Please sign in to comment.