oe/housenum-be-r-parser 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

oe/housenum-be-r-parser

Composer 安装命令:

composer require oe/housenum-be-r-parser

包简介

Splitter and Merger for Belgian housenumbers

README 文档

README

A small library for merging and splitting sequences of Belgian housenumbers.

https://travis-ci.org/OnroerendErfgoed/php-housenum-be-r-parser.png?branch=master https://coveralls.io/repos/OnroerendErfgoed/php-housenum-be-r-parser/badge.png?branch=master

Description

Splits ranges of Belgian house numbers into individual ones and vice versa.

Installation

The HousenumBErParser can be installed through composer:

//composer.json
{
    "require": {
        "oe/housenum-be-r-parser": "dev-master"
    }
}

Usage

Splitting a range of housenumbers:

<?php
use OE\HousenumBErParser\Facade;

$facade = new Facade();

echo "Splitting 15-21\n";

$split = $facade->split('15-21');

foreach($split as $hnr) {
    echo $hnr . "\n";
}

Merging housenumbers:

<?php
use OE\HousenumBErParser\Facade;

$facade = new Facade();

echo "Merging 17/1, 15, 20 bus C, 20 bus B, 17/3, 17/2, 20 bus A\n";

$merge = $facade->merge('17/1, 15, 20 bus C, 20 bus B, 17/3, 17/2, 20 bus A');

echo $facade->numbersToString($merge) . "\n";

The Facade can handle errors in three different ways. It can ignores errors (the default way of handling errors). In this case invalid input will be left as it is as much as possible. So, when trying to split the string 25, something, the resulting output will be 25, something.

The second option is to remove invalid input. This can be set by passing Reader::ERR_REMOVE_INVALID_INPUT to the Facade constructor. In this case, invalid input will be stripped as much as possible. So, when trying to split the string 25, something, the resulting output will be 25.

The third and final option is to throw Exceptions. This can be set by passing Reader::ERR_EXCEPTIONS to the Facade constructor. In this case, invalid input will trigger an Exception. So, when trying to split the string 25, something, an exception will be thrown.

Other languages

There is a similar library that does the same, but written in python.

统计信息

  • 总下载量: 7.72k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 7
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-07-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固