You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,9 @@
11
11
12
12
1. <b>CodeView</b> & related abstract adapter to provide options & customization (see below).<br>
13
13
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>
15
15
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>
17
17
18
18
## Download
19
19
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
38
38
CodeProcessor.init(this);
39
39
```
40
40
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.
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.
68
68
69
69
### Initialization
70
-
You can initialize view with options:
70
+
You can initialize the view with options:
71
71
```java
72
72
codeView.setOptions(Options.Default.get(this)
73
73
.withLanguage("python")
@@ -81,12 +81,12 @@ final CustomAdapter myAdapter = new CustomAdapter(this, getString(R.string.listi
81
81
codeView.setAdapter(myAdapter);
82
82
```
83
83
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.
85
85
86
86
### Options
87
87
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.
88
88
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:
90
90
```java
91
91
codeView.getOptions()
92
92
.withCode(R.string.listing_java)
@@ -100,7 +100,7 @@ There are some default themes (see full list below):
0 commit comments