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 - cescgie/multilingual-datefinder: A multilingual date extraction tool for text in English, German, Russian, Ukrainian, Italian, Portuguese, Spanish, Indonesian, Hindi, French, and Arabic

BranchesTags
Open more actions menu

Latest commit

 

History

12 Commits
12 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.js
index.js
 
 
normalize.js
normalize.js
 
 
package.json
package.json
 
 
patterns.js
patterns.js
 
 
test.js
test.js
 
 

Repository files navigation

Datefinder

Description

It finds dates in your text with Node.js and returns extracted strings, start and end indices, and the date object. It works for English, German, Russian, Ukrainian, Italian, Portuguese, Spanish, Indonesian, Hindi, French, and Arabic languages in the date range from 1900 to 2099.

Parameters

Method can be called by datefinder(text), where text is your text.

Installation

npm install multilingual-datefinder --save

Usage

CommonJS (Node.js)

const dateFinder = require('multilingual-datefinder');

let text = `Це трапилося 2 січня 2001 року.
Das Meeting findet am 15. März 2023 statt.
La réunion aura lieu le 15 avril 2024.
La reunión es el 15 de abril de 2024.
A reunião será em 15 de abril de 2024.
La riunione è il 15 aprile 2024.
Rapat pada tanggal 15 April 2024.
बैठक 15 अप्रैल 2024 को है।
الاجتماع في 15 أبريل 2024.`;

console.log(dateFinder(text));

ES Modules (Modern JavaScript)

import dateFinder from 'multilingual-datefinder';

let text = `Це трапилося 2 січня 2001 року.
Das Meeting findet am 15. März 2023 statt.
La réunion aura lieu le 15 avril 2024.
La reunión es el 15 de abril de 2024.
A reunião será em 15 de abril de 2024.
La riunione è il 15 aprile 2024.
Rapat pada tanggal 15 April 2024.
बैठक 15 अप्रैल 2024 को है।
الاجتماع في 15 أبريل 2024.`;

console.log(dateFinder(text));

Expected outcome:

[ { startIndex: 12,
    endIndex: 30,
    string: ' 2 січня 2001 року',
    date: 2001-01-02T00:00:00.000Z },
  { startIndex: 32,
    endIndex: 69,
    string: ' Das Meeting findet am 15. März 2023 statt.',
    date: 2023-03-15T00:00:00.000Z },
  { startIndex: 71,
    endIndex: 103,
    string: ' La réunion aura lieu le 15 avril 2024',
    date: 2024-04-15T00:00:00.000Z },
  // ... additional dates detected in other languages ... ]

Features

  • Multi-language support:
    • European: English, German, Russian, Ukrainian, Italian, French, Spanish, Portuguese
    • Middle Eastern: Arabic
    • South Asian: Hindi
    • Southeast Asian: Indonesian
  • Various date formats detection
  • Relative dates support (yesterday, tomorrow, etc.) in all supported languages
  • Verbal number detection in multiple scripts and languages
  • Time intervals recognition
  • Support for different calendar systems and date formats
  • Right-to-left (RTL) text support for Arabic

Changes from Original

This package is based on the original datefinder by Kyrylo Zakharov, with the following enhancements:

  • Added support for multiple new languages:
    • German language support
    • Romance languages (Italian, French, Spanish, Portuguese)
    • Arabic language with RTL support
    • Hindi language support
    • Indonesian language support
  • Improved patterns for better date detection
  • Enhanced support for relative dates and time expressions
  • Added support for various cultural date formats
  • Updated documentation with multilingual examples
  • Expanded test coverage for all supported languages

License

MIT

About

A multilingual date extraction tool for text in English, German, Russian, Ukrainian, Italian, Portuguese, Spanish, Indonesian, Hindi, French, and Arabic

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — 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.