GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - JetBrains/email-parser

BranchesTags
Open more actions menu

Latest commit

 

History

161 Commits
161 Commits

Folders and files

NameName
Last commit message
Last commit date
gradle/wrapper
gradle/wrapper
 
 
old_srcs
old_srcs
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
module.md
module.md
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

email-parser JetBrains team project

This simple library provides ability to separate the quotation from the useful content in email messages. The main purpose of this library is to process as much different quotation formats as possible. It is also independent from the language used in email.

Efficiency estimation we have got during testing: > 97.5 % correctly processed emails.

For now it works only with text/plain Content-Type. Other content-types may be added later (you are welcome to make a pull request).

Usage

You can download library sources and add them into your project.

To run in the console

Clone project via git and change directory to email-parser.

Process .eml file:

Enter gradlew runProcessing -PemlFile="path" in the console, where path is path to eml file.

Output format
Header of the quotation is in uppercase.
Quotation is marked with '>' symbol beginning with the first line of the header of the quotation till the end of the message.
Working time is also provided.

Tests:

Enter gradlew test in the console.

Documentation

To get documentation in dokka format enter gradlew dokka in the console. Then run build/dokka/email-parser/index.html

To get documentation in Javadoc format enter gradlew dokkaJavadoc in the console. Then run build/javadoc/index.html

Description

The main package of the library is quoteParser. Its main class is QuoteParser.

To use parser call quoteParserObj.parse() method. This method will return Content object with a separate body, header of the quote if exists and quotation itself if exists.

For more information, read the documentation.

Examples

Simple usage example:

val content = QuoteParser.Builder()
        .build()
        .parse(file)

You also can parse list of strings and customize parser parameters via different builder methods:

val content = QuoteParser.Builder()
        .deleteQuoteMarks(true)
        .recursive(false)
        .build()
        .parse(emlText.lines())

Kotlin-style builder is also supported:

val content = QuoteParser.Builder()
        .build {
            deleteQuoteMarks = true
            recursive = false
        }.parse(emlText.lines())

Complete code of the examples is placed here.

About

No description, website, or topics provided.

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

29 stars

Watchers

5 watching

Forks

6 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.