Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature connector md #88

Merged
merged 11 commits into from
Jun 1, 2023
Merged

Conversation

susu1101code
Copy link
Contributor

This update implements the basic ability of the connector to read content from the md file

Copy link
Owner

@li2109 li2109 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unrelated files(files inside .idea, etc) and update the gitignore to include those files.

import java.nio.file.Paths;

/** Implementation of DocumentConnector for Md files. */
public class MdConnector extends DocumentConnector<MdReadOption> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: MarkdownConnector

@@ -0,0 +1,29 @@
package ai.knowly.langtorch.connector.md;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: markdown

/** Implementation of ReadOption for Markdown files. */
@Data
@Builder(toBuilder = true, setterPrefix = "set")
public class MdReadOption implements ReadOption {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: MarkdownOption

import static com.google.common.truth.Truth.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class MdConnectorTest {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: MarkdownConnectorTest

/** Implementation of DocumentConnector for Md files. */
public class MdConnector extends DocumentConnector<MdReadOption> {
private MdConnector(){};

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove ;

@Override
protected String read(MdReadOption readOption) throws IOException {
// Read the Markdown file content
return new String(Files.readAllBytes(Paths.get(readOption.getFilePath())));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding charset
new String(
Files.readAllBytes(Paths.get(readOption.getFilePath())), StandardCharsets.UTF_8);

build.gradle Outdated
@@ -120,6 +120,8 @@ dependencies {
implementation 'org.apache.pdfbox:pdfbox:2.0.28'
// Reading CSV
implementation 'org.apache.commons:commons-csv:1.10.0'
// Reading Markdown
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this dependency is not used. please remove it.

@li2109
Copy link
Owner

li2109 commented May 30, 2023

Btw, could you update the package from "csv" to "spreadsheet"?

@li2109 li2109 self-requested a review May 30, 2023 16:25
@li2109
Copy link
Owner

li2109 commented May 30, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Please also resolve the detected code smell issues

susu1101code and others added 7 commits June 1, 2023 13:46
adding charset
style:
change md by markdown
update package from "csv" to "spreadsheet"
remove unused dependency and idea files
change md by markdown
@sonarcloud
Copy link

sonarcloud bot commented Jun 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@li2109 li2109 merged commit 900924f into li2109:master Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants