Comments (2)
It sounds interesting.
We could also use a parameter like join_delimiter
or something like that to choose how to join the followed numbers (that are followed omitting spaces, commas, etc).
Examples:
>>> parse('I have three numbers: one, two, three', join_delimiter='-')
'I have 3 numbers: 1-2-3'
>>> parse('I have three numbers: one, two, three', join_delimiter='')
'I have 3 numbers: 123'
>>> parse('I have three numbers: one, two, three', join_delimiter='/')
'I have 3 numbers: 1/2/3'
>>> parse('two three zero two five eight', join_delimiter='.')
2.3.0.2.5.8
from number-parser.
@noviluni sir, this is what I am thinking what do you suggest?
From this code
myvalue = _build_number(tokens_taken, lang_data)
for each_number in myvalue:
current_sentence.append(each_number)
current_sentence.append(" ")
To this code
if tokens_taken:
myvalue = _build_number(tokens_taken, lang_data)
for each_number in myvalue:
if delimeter:
current_sentence.append(each_number)
current_sentence.append(delimeter)
else:
current_sentence.append(each_number)
current_sentence.append(" ")
Here, I have added a new parameter - delimiter into the parse
function
Links for the code
number-parser/number_parser/parser.py
Line 308 in dab1f31
number-parser/number_parser/parser.py
Line 287 in dab1f31
from number-parser.
Related Issues (20)
- Adding support for languages with discernible delimiters HOT 3
- Idiosyncracies in each language.
- The links at the end of README.rst file are redirecting HOT 2
- Documentation and Understanding of the code HOT 1
- Use of " And " with numeric word and symbols are different HOT 1
- Support for simple fractions HOT 7
- Integrate number-parser into dateparser and price-parser HOT 15
- [Query] number parser HOT 5
- Mixing between digits and character number HOT 2
- Unicode error in pytest for Hindi, Spansish and Russian in Windows.
- First day is not 1 day or second day is not 2 day HOT 2
- Update package on PyPI for parsing a fraction HOT 1
- dangling "and" is swallowed HOT 3
- `parse()` - whitespace around sentence separators consumed after numbers HOT 1
- Doesn't recognize a million in Ukrainian
- Replace OrderedDict to dict
- Parsing for numbers with an apostrophe in Ukrainian does not work
- Add __version__ attribute
- After updating to 0.3.1, can no longer import number_parser HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from number-parser.