Skip to content

WordNet data path is parsed incorrectly on Windows #2

@Ulenspiegel

Description

@Ulenspiegel

On Windows, the library only recognizes WordNet data residing in directories named .\data*. That's because file filtering in wnram.New() is done using 'path.Base(), which doesn't handle backslash directory path separators properly:

		if strings.HasPrefix(path.Base(filename), ".") || strings.HasSuffix(filename, "~") || strings.HasSuffix(filename, "#") {
			return nil
		}
		// read only data files
		if !strings.HasPrefix(path.Base(filename), "data") {
			return nil
		}

Think both cases should be replaced with the cross-platform filepath.Base() to work correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions