Skip to content

Commit 3250bdf

Browse files
authored
Merge pull request #28 from JamieKalloe/master
Update README.md
2 parents 13fe36e + d542fe6 commit 3250bdf

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
1. <b>CodeView</b> & related abstract adapter to provide options & customization (see below).<br>
1313

14-
2. For highlighting it uses <b>CodeHighlighter</b>, just highlights your code & returns formatted content. It based on [Google Prettify](https://github.com/google/code-prettify) and their Java implementation & [fork](https://github.com/google/code-prettify).<br>
14+
2. For highlighting it uses <b>CodeHighlighter</b>, it highlights your code & returns formatted content. It's based on [Google Prettify](https://github.com/google/code-prettify) and their Java implementation & [fork](https://github.com/google/code-prettify).<br>
1515

16-
3. <b>CodeClassifier</b> is trying to define what language presented in code snippet. It built using [Naive Bayes classifier](https://en.wikipedia.org/wiki/Naive_Bayes_classifier) upon found open-source [implementation](https://github.com/ptnplanet/Java-Naive-Bayes-Classifier), which I rewrote in Kotlin. There is no need to work with this class directly & you must just follow instructions below. (Experimental module, may not work properly!)<br>
16+
3. <b>CodeClassifier</b> is trying to define what language is presented in the code snippet. It's built using [Naive Bayes classifier](https://en.wikipedia.org/wiki/Naive_Bayes_classifier) upon found open-source [implementation](https://github.com/ptnplanet/Java-Naive-Bayes-Classifier), which I rewrote in Kotlin. There is no need to work with this class directly & you must just follow instructions below. (Experimental module, may not work properly!)<br>
1717

1818
## Download
1919
Add it in your root ```build.gradle``` at the end of repositories:
@@ -38,7 +38,7 @@ If you want to use code classifier to auto language recognizing just add to your
3838
CodeProcessor.init(this);
3939
```
4040

41-
Having done ones on app start you can classify language for different snippets more faster, because algorithm needs time for training on sets for presented listings of languages which library has.
41+
Having done ones on app start you can classify language for different snippets even faster, because the algorithm needs time for training on sets for the presented listings of the languages which the library has.
4242

4343
Add view to your layout & bind as usual:
4444
```xml
@@ -64,10 +64,10 @@ codeView.setCode(getString(R.string.listing_py), "py");
6464
```
6565

6666
## Customization
67-
When you call ```setCode(...)``` view will prepared with default params if view was not initialized before. So if you want some customization, it can be done using options and/or adapter.
67+
When you call ```setCode(...)``` the view will be prepared with the default params if the view was not initialized before. So if you want some customization, it can be done using the options and/or adapter.
6868

6969
### Initialization
70-
You can initialize view with options:
70+
You can initialize the view with options:
7171
```java
7272
codeView.setOptions(Options.Default.get(this)
7373
.withLanguage("python")
@@ -81,12 +81,12 @@ final CustomAdapter myAdapter = new CustomAdapter(this, getString(R.string.listi
8181
codeView.setAdapter(myAdapter);
8282
```
8383

84-
<b>Note:</b> Each <b>CodeView</b> has adapter and each adapter has options. When calling ```setOptions(...)``` or ```setAdapter(...)``` current adapter "flushed" with current options. If you want to save the state and just update options saving adapter or set adapter saving options you must call ```updateOptions(...)``` or ```updateAdapter(...)``` accordingly.
84+
<b>Note:</b> Each <b>CodeView</b> has a adapter and each adapter has options. When calling ```setOptions(...)``` or ```setAdapter(...)``` the current adapter is "flushed" with the current options. If you want to save the state and just update options saving adapter or set adapter saving options you must call ```updateOptions(...)``` or ```updateAdapter(...)``` accordingly.
8585

8686
### Options
8787
Options helps to easily set necessary params, such as code & language, color theme, shortcut params (max lines, note), code line click listener. Some params are unnecessary.
8888

89-
When view initialized (options or adapter are set) you can manipulate options in various ways:
89+
When the view is initialized (options or adapter are set) you can manipulate the options in various ways:
9090
```java
9191
codeView.getOptions()
9292
.withCode(R.string.listing_java)
@@ -100,7 +100,7 @@ There are some default themes (see full list below):
100100
codeView.getOptions().setTheme(ColorTheme.SOLARIZED_LIGHT);
101101
```
102102

103-
But you can build your own from existing one:
103+
But you can build your own from a existing one:
104104
```java
105105
ColorThemeData myTheme = ColorTheme.SOLARIZED_LIGHT.theme()
106106
.withBgContent(android.R.color.black)
@@ -116,7 +116,7 @@ codeView.getOptions().setTheme(customTheme);
116116
```
117117

118118
### Adapter
119-
Sometimes you may want to take code lines under your control, and that's why you need <b>Adapter</b>.
119+
Sometimes you may want to take code lines under your control, and that's why you need a <b>Adapter</b>.
120120

121121
You can create your own implementation as follows:
122122

0 commit comments

Comments
 (0)