Browse Source

REPORT-11709 AlphaFine整合小帆视觉验收

REPORT-11692 alphafine分词查询结果中包含了连词结果
final/10.0
alex.sung 6 years ago
parent
commit
0478434302
  1. 10
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java
  2. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java
  3. 5
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  4. 20
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java
  5. BIN
      designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@1x.png
  6. BIN
      designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@2x.png

10
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java

@ -2,9 +2,11 @@ package com.fr.design.mainframe.alphafine;
import com.fr.base.extension.FileExtension;
import com.fr.general.CloudCenter;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.util.ArrayList;
/**
@ -138,4 +140,12 @@ public class AlphaFineConstants {
public static final int RECOMMEND_MAX_ITEM_NUM = 3;
public static final String BACK_ICON_NAME = "back@1x.png";
public static final ArrayList<String> CONJUNCTION = new ArrayList<String>() {{
add("和");
add("与");
add("的");
}};
}

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java

@ -24,7 +24,7 @@ public class BottomCellRender implements ListCellRenderer<Object> {
JPanel line = new JPanel();
line.setPreferredSize(new Dimension(200, 1));
line.setBackground(AlphaFineConstants.GRAY);
line.setBackground(AlphaFineConstants.WHITE);
panel.add(line, BorderLayout.NORTH);
goToWebLabel.setFont(AlphaFineConstants.MEDIUM_FONT);

5
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -239,6 +239,7 @@ public class AlphaFineDialog extends UIDialog {
hotPane.setLayout(new BorderLayout());
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Hot"));
uiLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
uiLabel.setFont(AlphaFineConstants.SMALL_FONT);
uiLabel.setForeground(AlphaFineConstants.DARK_GRAY);
@ -1377,7 +1378,9 @@ public class AlphaFineDialog extends UIDialog {
*/
private void initBackPane() {
backPane = new JPanel(new BorderLayout());
JLabel jLabel = new JLabel(" < " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Back"));
JLabel jLabel = new JLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Back"));
jLabel.setIcon(IconLoader.getIcon(AlphaFineConstants.IMAGE_URL + AlphaFineConstants.BACK_ICON_NAME));
jLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
jLabel.setPreferredSize(new Dimension(80, 20));
jLabel.setFont(AlphaFineConstants.SMALL_FONT);
jLabel.setForeground(AlphaFineConstants.DARK_GRAY);

20
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java

@ -2,10 +2,10 @@ package com.fr.design.mainframe.alphafine.search.manager.impl;
import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.stable.StringUtils;
import com.fr.third.ibm.icu.text.BreakIterator;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -76,8 +76,26 @@ public class SegmentationManager {
result.add(temp);
}
}
result = removeConjunction(result);
String[] strings = new String[result.size()];
result.toArray(strings);
return strings;
}
/**
* 去除连词
*
* @param result
* @return
*/
public static List<String> removeConjunction(List<String> result) {
Iterator<String> it = result.iterator();
while (it.hasNext()) {
String s = it.next();
if (AlphaFineConstants.CONJUNCTION.contains(s)) {
it.remove();
}
}
return result;
}
}

BIN
designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

BIN
designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Loading…
Cancel
Save