Skip to content

Commit

Permalink
Readme Update
Browse files Browse the repository at this point in the history
  • Loading branch information
javadr committed Apr 4, 2022
1 parent e104d60 commit 9ce5f6f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 25 deletions.
31 changes: 9 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
Negar
======

Negar is a spell corrector for Persian language. I'm working on new algorithm that I found from here:

https://github.com/aziz/virastar/blob/master/lib/virastar.rb

Thank you Aziz.
Negar is an editor(=virastar in Persian) for Persian text. The project is initially inspired by [virastar](https://github.com/aziz/virastar/blob/master/lib/virastar.rb). Thank you [Aziz](https://github.com/aziz) for your great job.

Screenshot & Features
=====================
Expand All @@ -22,17 +18,13 @@ Installation

## PyPi

**python-negar** is available on PyPi:

http://pypi.python.org/pypi/python-negar
::
**python-negar** is available on [PyPi](http://pypi.python.org/pypi/python-negar):

$ pip install python-negar

## Git

You can get latest stable changes from github server:
::

$ git clone https://github.com/shahinism/python-negar.git
$ cd python-negar
Expand All @@ -42,10 +34,9 @@ You can get latest stable changes from github server:

You can grab the latest tarball.

### *unix
### *nix

Get the latest tarball & install
::
Get the latest tarball & install:

$ wget https://github.com/shahinism/python-negar/archive/master.tar.gz
$ tar xvzf python-negar-master.tar.gz && cd python-negar-master
Expand All @@ -57,31 +48,27 @@ Download latest zip archive.

https://github.com/shahinism/python-negar/archive/master.zip

Decompress it, and run the following command in root directory of python-negar
::
Decompress it, and run the following command in root directory of `python-negar`

$ python setup.py install


#### Requirements
The main class for text editing just relies on Python's standard library but the GUI part needs `PyICU`, `pyperclip`, and `pyqt6`.
::
#### Requirements
The main class for text editing just relies on Python's standard library but the GUI part needs `PyQt6`, `pyperclip`, and `PyICU`.

$ pip install PyICu pyperclip pyqt6
$ pip install PyQt6 PyICU pyperclip

Usage
======

Usage without extra args:
::

from negar.virastar import PersianEditor

text = "مانند 'همه ی ' که با 'ی' پسوند همراه هستند"
print(PersianEditor(text)) # Done ;)

Enabling extra features/args:
::

##
args = []
Expand All @@ -91,7 +78,6 @@ Enabling extra features/args:


Full list of args with description:
::

--fix-dashes Disable fix dashes feature
--fix-three-dots Disable fix three dots feature
Expand All @@ -110,4 +96,5 @@ Full list of args with description:
--cleanup-kashidas Disable cleanup kashidas feature
--cleanup-ex-marks Disable cleanup extra marks feature
--cleanup-spacing Disable cleanup spacing feature
--trim-lt-whitespaces Disable Trim leading trailing whitespaces

Binary file modified docs/screenshot/configtab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshot/maintab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion negar/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path

__version__ = "1.0.0"
__version__ = "1.0.1"

LOGO = (Path(__file__).parent.absolute()/"logo.png").as_posix()
DATAFILE = Path(__file__).parent.absolute()/"data/untouchable.dat"
Expand Down
2 changes: 1 addition & 1 deletion negar/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def option_control(self):
if not self.clnup_spacing.isChecked():
self.editing_options.append("cleanup-spacing")
if not self.trim_lt_whitespaces.isChecked():
self.editing_options.append("trim-leading-trailing-whitespaces")
self.editing_options.append("trim-lt-whitespaces")

def file_dialog(self):
fname, _ = QFileDialog.getOpenFileName(self, 'Open File - A Plain Text')
Expand Down
2 changes: 1 addition & 1 deletion negar/virastar.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, text, *args):
self._fix_arabic_numbers = is_in_args('fix-arabic-num')
self._fix_english_numbers = is_in_args('fix-english-num')
self._fix_misc_non_persian_chars = is_in_args('fix-non-persian-chars')
self._trim_leading_trailing_whitespaces = is_in_args('trim-leading-trailing-whitespaces')
self._trim_leading_trailing_whitespaces = is_in_args('trim-lt-whitespaces')

UnTouchable() # to generate the untouchable words
self.cleanup()
Expand Down

0 comments on commit 9ce5f6f

Please sign in to comment.